From 9b3f072292f5d742099d836862074b6349b05a77 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 19 Aug 2019 18:52:14 -0400 Subject: [PATCH] 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). --- src/bootstrap/builder.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index f0054c36c0c88..afde076a35a50 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -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); }