Skip to content

Commit

Permalink
Rollup merge of rust-lang#96757 - jyn514:fewer-clippy-rebuilds, r=Mar…
Browse files Browse the repository at this point in the history
…k-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 rust-lang#76495.
  • Loading branch information
matthiaskrgr authored May 7, 2022
2 parents 16892cf + 101f952 commit 2dcb6fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 2dcb6fd

Please sign in to comment.