Skip to content

Commit 4be5d36

Browse files
committed
Auto merge of #49311 - SimonSapin:bootstrap-vs-rustflags-the-return, r=Mark-Simulacrum
Use the same RUSTFLAGS for building and testing `bootstrap` This avoids recompiling the whole dependency graph twice for every `./x.py test` run. Fixes #49215
2 parents c08480f + e993e62 commit 4be5d36

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bootstrap/test.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,12 @@ impl Step for Bootstrap {
16941694
.env("CARGO_TARGET_DIR", build.out.join("bootstrap"))
16951695
.env("RUSTC_BOOTSTRAP", "1")
16961696
.env("RUSTC", &build.initial_rustc);
1697+
if let Some(flags) = option_env!("RUSTFLAGS") {
1698+
// Use the same rustc flags for testing as for "normal" compilation,
1699+
// so that Cargo doesn’t recompile the entire dependency graph every time:
1700+
// https://github.com/rust-lang/rust/issues/49215
1701+
cmd.env("RUSTFLAGS", flags);
1702+
}
16971703
if !build.fail_fast {
16981704
cmd.arg("--no-fail-fast");
16991705
}

0 commit comments

Comments
 (0)