-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix x.py clippy
throwing error about clippy
#95766
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
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@@ -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(|_| ()); |
There was a problem hiding this comment.
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 foradd_component
) - Remove all this hacky code running rustc --version; treat it just the same as --cfg=bootstrap for
build
andcheck
. - Either put a
todo!()
for stages other than 0, or buildtool::Clippy
in-tree before running them, rather than the host clippy.
@rustbot label -S-waiting-on-review +S-waiting-on-author |
The job Click to see the possible cause of the failure (guessed by this bot)
|
Previously,
x.py
clippy would throw an error about not having clippy installed for the current toolchain because it was invocating the wrong version of rustc. This changes it to use&self.initial_rustc
instead of a hardcoded command.Thank you to @jyn514 for helping!