-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Improve the rustc-side clippy development experience #76495
Comments
Note that at some point |
Last time I tried blessing clippy tests, that did not work, so I ended up manually adjusting stderr files. Maybe that's because I didn't try stage 2. Note that @rust-lang/clippy this issue has remained open for more than half a year. The clippy-subtree-merger put the burden of keeping clippy working onto all rustc contributors, so having sub-par tooling like this is now a much bigger problem than it was back when only clippy devs had to use that tooling. |
What was the error? That should work, if not it's a bug. |
|
I think |
Ah, turns out what I actually tried is |
This is already done, if something in the
That would be great. Unfortunately most Clippy folks don't really know how the bootstrapping works exactly and therefore fixing this would be really hard for us to do.
Changes to rustc should not change Clippy tests, except for line number updates. The only exception I can think of is if a lint is being uplifted from Clippy to rustc. Fixing the issue where a new rust error/lint suppresses Clippy lints should be fixed by either adding
Yes, Clippy on |
The error that @RalfJung linked is not a bootstrapping issue. Clippy's fork of compile test needs to be fixed not to reuse the same target directory for tests as for building clippy itself. |
Actually that works, since stage 1 is what |
Clippy uses the same fork that Miri uses, and Miri doesn't have this particular problem I think (at least, Miri worked on stage 0 before #78778 got introduced). However, it looks like clippy actually supports ui tests that depend on 3rd-party crates, so that logic might be wrong -- Miri doesn't have anything like this. |
Yes using external crates in compiletest causes some problems also in Clippy. So this is most likely the reason, why it also causes problems in the Rust repo. |
I just opened rust-lang/rust-clippy#7343 to explain the problem from Clippy's side. I'd appreciate feedback from people with more rustc knowledge. |
…k-Simulacrum Don't constantly rebuild clippy on `x test src/tools/clippy`. This happened because the `SYSROOT` variable was set for `x test`, but not `x build`. Set it consistently for both to avoid unnecessary rebuilds. This is a very small step towards rust-lang#76495.
I have a prototype for running clippy tests without having to build rustc twice in #96798, which is currently blocked on changing the stage numbering for tools: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Stage.20numbering.20for.20tools See #96798 (comment) for more details. |
this is likely fixed since #87337, although i haven't tested |
x clippy thanks to `@asquared31415` `@albertlarsan68` for all their help, most of this pr is their work note that this also adds x clippy --stage 0 -Awarnings to x86_64-gnu-llvm-15 to make sure it stays working; that won't gate on any clippy warnings, just enforce that clippy doesn't give a hard error. we can't add --stage 1 until clippy fixes its debug assertions not to panic. note that `x clippy --stage 1` currently breaks when combined with download-rustc. unlike the previous prs, this doesn't require changes to clippy (it works by using RUSTC_WRAPPER instead), and supports stage 0 read this commit-by-commit closes rust-lang#107628; see also rust-lang#106394, rust-lang#97443. fixes rust-lang#95988. helps with rust-lang#76495. r? bootstrap
x clippy thanks to `@asquared31415` `@albertlarsan68` for all their help, most of this pr is their work note that this also adds x clippy --stage 0 -Awarnings to x86_64-gnu-llvm-15 to make sure it stays working; that won't gate on any clippy warnings, just enforce that clippy doesn't give a hard error. we can't add --stage 1 until clippy fixes its debug assertions not to panic. note that `x clippy --stage 1` currently breaks when combined with download-rustc. unlike the previous prs, this doesn't require changes to clippy (it works by using RUSTC_WRAPPER instead), and supports stage 0 read this commit-by-commit closes rust-lang#107628; see also rust-lang#106394, rust-lang#97443. fixes rust-lang#95988. helps with rust-lang#76495. r? bootstrap
When working on #75573, I ended up needing to modify Clippy (both a lint implementation and some UI tests). This process left a lot to be desired, and could be a significant roadblock to new contributors. I came up with some ideas for improving the process:
./x.py test src/tools/clippy
requires a full compiler bootstrap (e.g. building a stage2 compiler). This takes a significant amount of time, and interacts badly with incremental compilation. For contributors with lower-end machines, this may make the contribution process incredibly frustrating. Attempting to build Clippy against a stage1 compiler (which requires running./x.py test src/tools/clippy --stage 0
for some reason) works, but the tests fail with a confusing error about LLVM being missing../x.py test --bless
. Currently, blessing Clippy UI tests requires manually running scripts from insidesrc/tools/clippy
. It would be nice if./x.py test --bless
worked on all UI tests, allowing Clippy to be largely treated as 'just another directory'.-D warnings
and Clippy lints. It seems as though denying a built-in lint with-D warnings
prevents Clippy lints from being run. Since Clippy UI tests are run with-D warnings
, adding a new builtin Rust lint can end up preventing Clippy UI tests from testing Clippy lints. Ideally, we would allow both sets of lints to run - if this is not possible, we should document the workaround (adding#![allow(problematic_rustc_lint)]
to the affected Clippy UI tests).The text was updated successfully, but these errors were encountered: