Skip to content

Commit

Permalink
handle rustc args properly in bootstrap
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
onur-ozkan committed Apr 5, 2024
1 parent 3d5528c commit 69a145a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2094,11 +2094,9 @@ impl<'a> Builder<'a> {
}

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

Cargo {
command: cargo,
Expand Down

0 comments on commit 69a145a

Please sign in to comment.