Skip to content

Commit 0bbac0c

Browse files
committed
Add musl_v1_2_3 feature
This feature, controlled by the environment variable RUST_LIBC_UNSTABLE_MUSL_1_2_3 will control whether breaking changes up to musl v1.2.3 will be reflected
1 parent d6972fc commit 0bbac0c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const ALLOWED_CFGS: &[&str] = &[
2121
"libc_ctest",
2222
// Corresponds to `__USE_TIME_BITS64` in UAPI
2323
"linux_time_bits64",
24+
"musl_v1_2_3"
2425
];
2526

2627
// Extra values to allow for check-cfg.
@@ -85,6 +86,11 @@ fn main() {
8586
_ => (),
8687
}
8788

89+
let musl_v1_2_3 = env::var("RUST_LIBC_UNSTABLE_MUSL_1_2_3").is_ok();
90+
println!("cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_MUSL_1_2_3");
91+
if musl_v1_2_3 {
92+
set_cfg("musl_v1_2_3");
93+
}
8894
let linux_time_bits64 = env::var("RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64").is_ok();
8995
println!("cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64");
9096
if linux_time_bits64 {

libc-test/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,7 +3656,12 @@ fn test_linux(target: &str) {
36563656
let wasm32 = target.contains("wasm32");
36573657
let uclibc = target.contains("uclibc");
36583658

3659+
let musl_v1_2_3 = env::var("RUST_LIBC_UNSTABLE_MUSL_1_2_3").is_ok();
3660+
36593661
let mut cfg = ctest_cfg();
3662+
if musl_v1_2_3 {
3663+
cfg.cfg("musl_v1_2_3", None);
3664+
}
36603665
cfg.define("_GNU_SOURCE", None);
36613666
// This macro re-defines fscanf,scanf,sscanf to link to the symbols that are
36623667
// deprecated since glibc >= 2.29. This allows Rust binaries to link against

0 commit comments

Comments
 (0)