Add RUSTC_STAGE env var to ./x.py clippy invocation#100492
Add RUSTC_STAGE env var to ./x.py clippy invocation#100492khyperia wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
|
Unfortunately, this is not the right fix. RUSTC_STAGE is read ~only by the bootstrap rustc shim we use to thread down certain arguments that can't be passed via RUSTFLAGS (and some legacy flags). I'm not quite sure why your PATH is setup such that that rustc is what is running here, that seems odd. This code has always been pretty iffy; it's trying to avoid a proper integration into bootstrap (e.g., like we do for rustfmt), and that makes it pay the cost of being often broken in individual user's configurations. Since we don't officially support running Clippy on the standard library or compiler codebase, it's not something that we've invested time into fixing. |
Good to know! A bit confusing to have an official-looking
Same! Printing I'll just close this then if it's just an issue on my machine. |
I have absolutely no idea if
./x.py clippyis supposed to be supported or work these days, but it didn't for me, so I figured I'd fix it.Important: #97443 by @asquared31415 deletes this bit of code. I'm not sure if that PR is still alive or not, or if this PR should be discarded in favor of that one, idk, I'm just blindly whacking at infra until it seems to work.
Before this change, when I ran
./x.py clippy, it told me torustup component add clippy. This was entirely unhelpful, as I already had clippy installed! So I expanded the error reporting to report the actual error, and it spit this out:So, I added in a
.env("RUSTC_STAGE", stage.to_string()), and it seems to mostly work now!... until it reaches
Checking stage0 clippy artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc), at which point it errors out witherror: internal compiler error: compiler\rustc_monomorphize\src\collector.rs:1031:9: no MIR available for DefId(1:6900 ~ std[81ca]::process::{impl#22}::new)(oh the irony, clippy ICE'ing when it tries to check clippy).In any case, the situation seems better than before, so I figured I'd submit this anyway.