about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorJoshua Nelson <jnelson@cloudflare.com>2022-05-05 20:37:08 -0500
committerJoshua Nelson <jnelson@cloudflare.com>2022-05-05 20:40:01 -0500
commit101f9522651f05d58f7e07d20d841be189841843 (patch)
tree800556331ae060cf5066a5227548ac874af2579e /src/bootstrap
parent30f386087564243ab88a93c984c265290a31580b (diff)
downloadrust-101f9522651f05d58f7e07d20d841be189841843.tar.gz
rust-101f9522651f05d58f7e07d20d841be189841843.zip
Don't constantly rebuild clippy on `x test src/tools/clippy`.
This happened because the `SYSROOT` variable was set for `x test`, but not `x build`.
Set it consistently for both to avoid unnecessary rebuilds.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/test.rs2
-rw-r--r--src/bootstrap/tool.rs4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 4dfc02dea46..8f2347be90e 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -664,8 +664,6 @@ impl Step for Clippy {
             &[],
         );
 
-        // clippy tests need to know about the stage sysroot
-        cargo.env("SYSROOT", builder.sysroot(compiler));
         cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler));
         cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler));
         let host_libs = builder.stage_out(compiler, Mode::ToolRustc).join(builder.cargo_dir());
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index fc1c2f04fab..3b30e6de12a 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -250,6 +250,10 @@ pub fn prepare_tool_cargo(
         }
     }
 
+    // clippy tests need to know about the stage sysroot. Set them consistently while building to
+    // avoid rebuilding when running tests.
+    cargo.env("SYSROOT", builder.sysroot(compiler));
+
     // if tools are using lzma we want to force the build script to build its
     // own copy
     cargo.env("LZMA_API_STATIC", "1");