Skip to content

Commit 2dcb6fd

Browse files
authored
Rollup merge of #96757 - jyn514:fewer-clippy-rebuilds, r=Mark-Simulacrum
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. This is a very small step towards #76495.
2 parents 16892cf + 101f952 commit 2dcb6fd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/bootstrap/test.rs

-2
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,6 @@ impl Step for Clippy {
664664
&[],
665665
);
666666

667-
// clippy tests need to know about the stage sysroot
668-
cargo.env("SYSROOT", builder.sysroot(compiler));
669667
cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler));
670668
cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler));
671669
let host_libs = builder.stage_out(compiler, Mode::ToolRustc).join(builder.cargo_dir());

src/bootstrap/tool.rs

+4
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ pub fn prepare_tool_cargo(
250250
}
251251
}
252252

253+
// clippy tests need to know about the stage sysroot. Set them consistently while building to
254+
// avoid rebuilding when running tests.
255+
cargo.env("SYSROOT", builder.sysroot(compiler));
256+
253257
// if tools are using lzma we want to force the build script to build its
254258
// own copy
255259
cargo.env("LZMA_API_STATIC", "1");

0 commit comments

Comments
 (0)