Skip to content

Commit 804d8c8

Browse files
committed
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.
2 parents 9ceaa56 + c6bae16 commit 804d8c8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bootstrap/builder.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,9 @@ impl<'a> Builder<'a> {
555555
let mut extra_args = env::var(&format!("RUSTFLAGS_STAGE_{}", stage)).unwrap_or_default();
556556
if stage != 0 {
557557
let s = env::var("RUSTFLAGS_STAGE_NOT_0").unwrap_or_default();
558-
extra_args.push_str(" ");
558+
if !extra_args.is_empty() {
559+
extra_args.push_str(" ");
560+
}
559561
extra_args.push_str(&s);
560562
}
561563

0 commit comments

Comments
 (0)