Skip to content

Commit

Permalink
Respect RUSTC_BOOTSTRAP=-1 in rustc version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Nov 19, 2024
1 parent 18aadd2 commit 07f64d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,11 @@ mod version {
}
let minor = digits.next()?.parse::<u32>().ok()?;
let _patch = digits.next().unwrap_or("0").parse::<u32>().ok()?;
let nightly = channel == "nightly" || channel == "dev";
let nightly = match env::var_os("RUSTC_BOOTSTRAP") {
// When -1 is passed rustc works like stable, e.g., cfg(target_feature = "unstable_target_feature") will never be set. /~https://github.com/rust-lang/rust/pull/132993
Some(v) if v == "-1" => false,
_ => channel == "nightly" || channel == "dev",
};

// Note that rustc 1.49-1.50 (and 1.13 or older) don't print LLVM version.
let llvm_major = (|| {
Expand Down

0 comments on commit 07f64d5

Please sign in to comment.