Skip to content

Commit

Permalink
Set CARGO instead of PATH for Rust Clippy
Browse files Browse the repository at this point in the history
Resolves #123227
  • Loading branch information
Rajveer100 committed Apr 2, 2024
1 parent 36b6f9b commit 0150ec7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1196,11 +1196,10 @@ impl<'a> Builder<'a> {
pub fn cargo_clippy_cmd(&self, run_compiler: Compiler) -> Command {
let initial_sysroot_bin = self.initial_rustc.parent().unwrap();
// Set PATH to include the sysroot bin dir so clippy can find cargo.
// FIXME: once rust-clippy#11944 lands on beta, set `CARGO` directly instead.
let path = t!(env::join_paths(
// The sysroot comes first in PATH to avoid using rustup's cargo.
std::iter::once(PathBuf::from(initial_sysroot_bin))
.chain(env::split_paths(&t!(env::var("PATH"))))
.chain(env::split_paths(&t!(env::var("CARGO"))))
));

if run_compiler.stage == 0 {
Expand Down

0 comments on commit 0150ec7

Please sign in to comment.