about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-03-23 19:55:41 +0100
committerSimon Sapin <simon.sapin@exyr.org>2018-03-23 19:55:41 +0100
commite993e6234181b0cc90b2aaa92ffbad4ea5b6a4da (patch)
tree1e149c17e129730926cf50ea6ca8bdca8c8d5c97 /src
parentcc34ca1c9787fde84116637a0cee92fc5e375e3d (diff)
downloadrust-e993e6234181b0cc90b2aaa92ffbad4ea5b6a4da.tar.gz
rust-e993e6234181b0cc90b2aaa92ffbad4ea5b6a4da.zip
Use the same RUSTFLAGS for building and testing `bootstrap`
Fixes #49215
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/test.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index d5c837c1274..5da4a8a4507 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -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 doesn’t 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");
         }