Skip to content

Commit 08c8996

Browse files
Only set *FLAGS env vars if they are not empty
1 parent 0658259 commit 08c8996

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/bootstrap/builder.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -1405,8 +1405,16 @@ impl Cargo {
14051405

14061406
impl From<Cargo> for Command {
14071407
fn from(mut cargo: Cargo) -> Command {
1408-
cargo.command.env("RUSTFLAGS", &cargo.rustflags.0);
1409-
cargo.command.env("RUSTDOCFLAGS", &cargo.rustdocflags.0);
1408+
let rustflags = &cargo.rustflags.0;
1409+
if !rustflags.is_empty() {
1410+
cargo.command.env("RUSTFLAGS", rustflags);
1411+
}
1412+
1413+
let rustdocflags = &cargo.rustdocflags.0;
1414+
if !rustdocflags.is_empty() {
1415+
cargo.command.env("RUSTDOCFLAGS", rustdocflags);
1416+
}
1417+
14101418
cargo.command
14111419
}
14121420
}

0 commit comments

Comments
 (0)