Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix x.py clippy throwing error about clippy #95766

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ impl<'a> Builder<'a> {
// Only run clippy on a very limited subset of crates (in particular, not build scripts).
cargo.arg("-Zunstable-options");
// Explicitly does *not* set `--cfg=bootstrap`, since we're using a nightly clippy.
let host_version = Command::new("rustc").arg("--version").output().map_err(|_| ());
let host_version = Command::new(&self.initial_rustc).arg("--version").output().map_err(|_| ());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, so this fixes your immediate issue, but it surprises me that it works - it's going to just unconditionally use --cfg bootstrap now, even though it's still using the host clippy. Maybe it didn't come up because this is so soon after the beta bump?

I think ideally the fix would look something like:

  • Download clippy for the bootstrap toolchain in bootstrap.py (look for add_component)
  • Remove all this hacky code running rustc --version; treat it just the same as --cfg=bootstrap for build and check.
  • Either put a todo!() for stages other than 0, or build tool::Clippy in-tree before running them, rather than the host clippy.

let output = host_version.and_then(|output| {
if output.status.success() {
Ok(output)
Expand Down