about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-01 05:09:48 +0000
committerbors <bors@rust-lang.org>2018-04-01 05:09:48 +0000
commit804d8c88d973d8a2dff5ddad11893a57ccf37956 (patch)
tree5b2a9b82365c101049292407aa6e7971851c740e /src/bootstrap
parent9ceaa5676b4ad706a3919526fc38fbfdbb142289 (diff)
parentc6bae16dc2e75456786e0f7af39f0cf9e3186bb5 (diff)
downloadrust-804d8c88d973d8a2dff5ddad11893a57ccf37956.tar.gz
rust-804d8c88d973d8a2dff5ddad11893a57ccf37956.zip
Auto merge of #49530 - petrhosek:empty-extra-flags, r=cramertj
Only include space in RUSTFLAGS extra flags if not empty

When the RUSTFLAGS_STAGE_{1,2} is not set, including a space means
the string will always be non-empty and RUSTFLAGS will be always be
reset which breaks other ways of setting these such as through config
in CARGO_HOME.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/builder.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index eb23236638b..0464840c3e8 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -555,7 +555,9 @@ impl<'a> Builder<'a> {
         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(" ");
+            if !extra_args.is_empty() {
+                extra_args.push_str(" ");
+            }
             extra_args.push_str(&s);
         }