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.
This commit is contained in:
@@ -555,7 +555,9 @@ impl<'a> Builder<'a> {
|
|||||||
let mut extra_args = env::var(&format!("RUSTFLAGS_STAGE_{}", stage)).unwrap_or_default();
|
let mut extra_args = env::var(&format!("RUSTFLAGS_STAGE_{}", stage)).unwrap_or_default();
|
||||||
if stage != 0 {
|
if stage != 0 {
|
||||||
let s = env::var("RUSTFLAGS_STAGE_NOT_0").unwrap_or_default();
|
let s = env::var("RUSTFLAGS_STAGE_NOT_0").unwrap_or_default();
|
||||||
|
if !extra_args.is_empty() {
|
||||||
extra_args.push_str(" ");
|
extra_args.push_str(" ");
|
||||||
|
}
|
||||||
extra_args.push_str(&s);
|
extra_args.push_str(&s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user