-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Pass Clippy args also trough RUSTFLAGS #6441
Conversation
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.
It took me some time to understand what this was doing exactly (which is probably because of the hackiness of our driver). I think we can improve this a bit by moving the handling of the rustflags
around.
I don't blame you, this is an ugly hack :) but I think for the moment it's a big win in usability. I think you already got it, but the general idea is to pass our args twice, once in |
Also: enable tests for cargo-clippy
767c947
to
f93d965
Compare
@bors r+ Thanks! |
📌 Commit f93d965 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Revert "Pass Clippy args also trough RUSTFLAGS" Reverts #6441 r? `@ebroto` changelog: Revert "Pass Clippy args also trough RUSTFLAGS"
Let Cargo track CLIPPY_ARGS This PR makes `clippy-driver` emit `CLIPPY_ARGS` in its `dep-info` output. Just like #6441, this allows this workflow to work: ```shell cargo clippy # warning: empty `loop {}` wastes CPU cycles cargo clippy -- -A clippy::empty_loop # no warnings emitted ``` But without rebuilding all dependencies. cc https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/CLIPPY_ARGS.20is.20not.20tracked.20by.20Cargo/near/228599088 Changelog: Cargo now re-runs Clippy if arguments after `--` provided to `cargo clippy` are changed.
Let Cargo track CLIPPY_ARGS This PR makes `clippy-driver` emit `CLIPPY_ARGS` in its `dep-info` output. Just like #6441, this allows this workflow to work: ```shell cargo clippy # warning: empty `loop {}` wastes CPU cycles cargo clippy -- -A clippy::empty_loop # no warnings emitted ``` But without rebuilding all dependencies. cc https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/CLIPPY_ARGS.20is.20not.20tracked.20by.20Cargo/near/228599088 changelog: Cargo now re-runs Clippy if arguments after `--` provided to `cargo clippy` are changed.
This removes a hack (__CLIPPY_HACKERY__) to add another one :)
It allows this workflow to work:
Before this change the new flag was not taken into consideration in cargo's fingerprint and the warning was emitted again. I guess that ideally we could add a specific env var for compiler wrapper arguments, but in the meantime this should do the job.
changelog: Pass clippy arguments through RUSTFLAGS so that changing them will trigger a rebuild
r? @flip1995
cc @ehuss (I think this may count as another step towards stabilizing
RUSTC_WORKSPACE_WRAPPER
😄)Fixes #5214 and avoids frustration for users unfamiliar with the issue