Skip to content

Commit 101f952

Browse files
committed
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.
1 parent 30f3860 commit 101f952

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)