Skip to content

Commit e993e62

Browse files
committed
Use the same RUSTFLAGS for building and testing bootstrap
Fixes #49215
1 parent cc34ca1 commit e993e62

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
@@ -1679,6 +1679,12 @@ impl Step for Bootstrap {
16791679
.env("CARGO_TARGET_DIR", build.out.join("bootstrap"))
16801680
.env("RUSTC_BOOTSTRAP", "1")
16811681
.env("RUSTC", &build.initial_rustc);
1682+
if let Some(flags) = option_env!("RUSTFLAGS") {
1683+
// Use the same rustc flags for testing as for "normal" compilation,
1684+
// so that Cargo doesn’t recompile the entire dependency graph every time:
1685+
// https://github.com/rust-lang/rust/issues/49215
1686+
cmd.env("RUSTFLAGS", flags);
1687+
}
16821688
if !build.fail_fast {
16831689
cmd.arg("--no-fail-fast");
16841690
}

0 commit comments

Comments
 (0)