Skip to content

Commit

Permalink
Unrolled build for rust-lang#123489
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#123489 - onur-ozkan:handle-rustc-args-properly, r=clubby789

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`.

Fixes rust-lang#123228
  • Loading branch information
rust-timer authored Apr 5, 2024
2 parents 5958f5e + 199589d commit 5cbb629
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2102,12 +2102,10 @@ impl<'a> Builder<'a> {
rustdocflags.arg("--cfg=parallel_compiler");
}

// 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(" "));
}
// Pass the value of `--rustc-args` from test command. If it's not a test command, this won't set anything.
self.config.cmd.rustc_args().iter().for_each(|v| {
rustflags.arg(v);
});

Cargo {
command: cargo,
Expand Down

0 comments on commit 5cbb629

Please sign in to comment.