Use the same RUSTFLAGS for building and testing bootstrap

Fixes #49215
This commit is contained in:
Simon Sapin 2018-03-23 19:55:41 +01:00
parent cc34ca1c97
commit e993e62341

View File

@ -1679,6 +1679,12 @@ impl Step for Bootstrap {
.env("CARGO_TARGET_DIR", build.out.join("bootstrap"))
.env("RUSTC_BOOTSTRAP", "1")
.env("RUSTC", &build.initial_rustc);
if let Some(flags) = option_env!("RUSTFLAGS") {
// Use the same rustc flags for testing as for "normal" compilation,
// so that Cargo doesnt recompile the entire dependency graph every time:
// https://github.com/rust-lang/rust/issues/49215
cmd.env("RUSTFLAGS", flags);
}
if !build.fail_fast {
cmd.arg("--no-fail-fast");
}