Don't use stage naming in RUSTFLAGS environment variables

This patch supports less behavior than before, since specifiying stage 1
vs stage 2 is no longer possible, but that is presumably a somewhat rare
use case anyway, so not supporting it seems acceptable (and it can be
readded easily if desired).
This commit is contained in:
Mark Rousskov 2019-08-19 18:52:14 -04:00
parent 29a54035c7
commit 9b3f072292

View File

@ -859,12 +859,12 @@ impl<'a> Builder<'a> {
stage = compiler.stage;
}
let mut extra_args = env::var(&format!("RUSTFLAGS_STAGE_{}", stage)).unwrap_or_default();
let mut extra_args = String::new();
if stage != 0 {
let s = env::var("RUSTFLAGS_STAGE_NOT_0").unwrap_or_default();
if !extra_args.is_empty() {
extra_args.push_str(" ");
}
let s = env::var("RUSTFLAGS_NOT_BOOTSTRAP").unwrap_or_default();
extra_args.push_str(&s);
} else {
let s = env::var("RUSTFLAGS_BOOTSTRAP").unwrap_or_default();
extra_args.push_str(&s);
}