diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-03 17:15:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-03 17:15:49 +0200 |
| commit | 29c72ce18382c030f5f3124808dcbd7695397439 (patch) | |
| tree | 9db645620e4370fdcb9076d58cb8dafe6d158e55 /src | |
| parent | 94c402733d8bca4675fc8040cd968ecc5e5387a0 (diff) | |
| parent | 66dee4a9aa759748319f4e9c81dbb87d7e759ee0 (diff) | |
| download | rust-29c72ce18382c030f5f3124808dcbd7695397439.tar.gz rust-29c72ce18382c030f5f3124808dcbd7695397439.zip | |
Rollup merge of #123386 - Rajveer100:branch-for-issue-123227, r=onur-ozkan
Set `CARGO` instead of `PATH` for Rust Clippy Resolves #123227 Previously, clippy was using `cargo` from `PATH`, but since [PR](https://github.com/rust-lang/rust-clippy/pull/11944), it now prioritises checking `CARGO` first.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/builder.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index c051b818328..0cce5130f64 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -1194,20 +1194,11 @@ 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")))) - )); - if run_compiler.stage == 0 { // `ensure(Clippy { stage: 0 })` *builds* clippy with stage0, it doesn't use the beta clippy. let cargo_clippy = self.build.config.download_clippy(); let mut cmd = Command::new(cargo_clippy); - cmd.env("PATH", &path); + cmd.env("CARGO", &self.initial_cargo); return cmd; } @@ -1227,7 +1218,7 @@ impl<'a> Builder<'a> { let mut cmd = Command::new(cargo_clippy); cmd.env(helpers::dylib_path_var(), env::join_paths(&dylib_path).unwrap()); - cmd.env("PATH", path); + cmd.env("CARGO", &self.initial_cargo); cmd } |
