Skip to content

Commit 69a145a

Browse files
committed
handle rustc args properly in bootstrap
Because `RUSTFLAGS` gets overwritten during the conversion from `Cargo` to `Command`, the passed rustc args were being lost. This change combines the rustc args with the values that override `RUSTFLAGS`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 3d5528c commit 69a145a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/bootstrap/src/core/builder.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -2094,11 +2094,9 @@ impl<'a> Builder<'a> {
20942094
}
20952095

20962096
// set rustc args passed from command line
2097-
let rustc_args =
2098-
self.config.cmd.rustc_args().iter().map(|s| s.to_string()).collect::<Vec<_>>();
2099-
if !rustc_args.is_empty() {
2100-
cargo.env("RUSTFLAGS", &rustc_args.join(" "));
2101-
}
2097+
self.config.cmd.rustc_args().iter().for_each(|v| {
2098+
rustflags.arg(v);
2099+
});
21022100

21032101
Cargo {
21042102
command: cargo,

0 commit comments

Comments
 (0)