Skip to content

Commit 0615e6b

Browse files
authored
Rollup 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 6c73231 + e993e62 commit 0615e6b

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

0 commit comments

Comments
 (0)