Skip to content

set CARGO instead of PATH #123227

Closed
Closed
@onur-ozkan

Description

@onur-ozkan

Previously, clippy was using cargo from PATH, but since rust-lang/rust-clippy#11944, it now prioritizes checking CARGO first. We can now set cargo path into CARGO and avoid appending it to the PATH chain.

In the bootstrap, we have this piece of code

// 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"))))
));
which adds cargo into PATH. As indicated by the FIXME note, rust-lang/rust-clippy#11944 wasn't merged at the time. Now that we can do so, set CARGO instead of PATH and remove the FIXME note.

Metadata

Metadata

Labels

E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions