Skip to content

Commit

Permalink
Auto merge of #49530 - petrhosek:empty-extra-flags, r=cramertj
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Apr 1, 2018
2 parents 9ceaa56 + c6bae16 commit 804d8c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 804d8c8

Please sign in to comment.