Add per-stage RUSTFLAGS: RUSTFLAGS_STAGE_{0,1,2} and RUSTFLAGS_STAGE_NOT_0
Fixes #47658.
This commit is contained in:
@@ -469,6 +469,18 @@ impl<'a> Builder<'a> {
|
|||||||
stage = compiler.stage;
|
stage = compiler.stage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut extra_args = env::var(&format!("RUSTFLAGS_STAGE_{}", stage)).unwrap_or_default();
|
||||||
|
if stage != 0 {
|
||||||
|
let s = env::var("RUSTFLAGS_STAGE_NOT_0").unwrap_or_default();
|
||||||
|
extra_args.push_str(" ");
|
||||||
|
extra_args.push_str(&s);
|
||||||
|
}
|
||||||
|
|
||||||
|
if !extra_args.is_empty() {
|
||||||
|
cargo.env("RUSTFLAGS",
|
||||||
|
format!("{} {}", env::var("RUSTFLAGS").unwrap_or_default(), extra_args));
|
||||||
|
}
|
||||||
|
|
||||||
// Customize the compiler we're running. Specify the compiler to cargo
|
// Customize the compiler we're running. Specify the compiler to cargo
|
||||||
// as our shim and then pass it some various options used to configure
|
// as our shim and then pass it some various options used to configure
|
||||||
// how the actual compiler itself is called.
|
// how the actual compiler itself is called.
|
||||||
|
|||||||
Reference in New Issue
Block a user