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

Non-reproducible warnings #6597

Closed
qrilka opened this issue Jan 15, 2021 · 6 comments
Closed

Non-reproducible warnings #6597

qrilka opened this issue Jan 15, 2021 · 6 comments
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@qrilka
Copy link

qrilka commented Jan 15, 2021

I was running clippy on the project https://github.com/rust-secure-code/cargo-geiger
And the version I was using was

$ cargo clippy -- --version
clippy 0.0.212 (04488af 2020-08-24)

This resulted in the commit qrilka/cargo-geiger@ef23658 fixing 2 minor issues which seem to make sense to me. I was surprised to see that clippy complained about match_like_matches_macro at https://github.com/rust-secure-code/cargo-geiger/blob/31e66faecce961e932567823efbc190a21b11f5c/cargo-geiger/src/graph.rs#L28
That made me update clippy and as a result I got a version

$ cargo clippy -- --version
clippy 0.0.212 (e1884a8 2020-12-29)

which seems to be the same but probably with some deps updated.

I expected to see the new clippy show me the same warnings and do not complain about match_like_matches_macro anymore.

Instead, I saw now warnings at all at the same code. Are clippy warnings supposed to be non-reproducible?

Meta

  • rustc -Vv:

rustc 1.49.0 (e1884a8e3 2020-12-29)
binary: rustc
commit-hash: e1884a8e3c3e813aada8254edfa120e85bf5ffca
commit-date: 2020-12-29
host: x86_64-unknown-linux-gnu
release: 1.49.0

@qrilka qrilka added the C-bug Category: Clippy is not doing the correct thing label Jan 15, 2021
@rail-rain
Copy link
Contributor

@qrilka I'm assuming the reason why you said "which seems to be the same but probably with some deps updated" is the version of Clippy stayed 0.0.212, is that correct? If so, this is expected because Clippy hasn't changed its version number since 2018 even though there has been so many changes. Therefore, since your new Clippy have different date; there should be some changes. (Apparently, every version of rustc has different Clippy with tied to it (#4167 (comment)) so if you update Rust with rustup, your clippy component will be technically a new version of it although the version number will be the same.)

@qrilka
Copy link
Author

qrilka commented Jan 18, 2021

@rail-rain is there any motivation behind this surprising version handling?

@rail-rain
Copy link
Contributor

@qrilka Honestly, I don't know why this started; but I've found thread , in which the Clippy team eventually decided to name the versions of Clippy after the corresponding Rust versions similar to Cargo; so this problem will go soon.

@camsteffen
Copy link
Contributor

Are clippy warnings supposed to be non-reproducible?

@qrilka Can you explain the question?

@qrilka
Copy link
Author

qrilka commented Feb 6, 2021

@camsteffen from what I was observing it looked like the same version of clippy was reporting different warnings (actually reporting and not reporting) in 2 cases with only rustup update in between (if I remember correctly). If version reporting in clippy is correct (but as @rail-rain said it's probably not) then it looks like warnings are not reproducible. That would mean for example that Alice with version X of clippy could see different warnings than Bob having the same clippy version (but for example different version of Rust toolchain).
So my question was is it really the case and if it is then I'd propose to find a way to fix that as reproducibility is quite important for a developer tool.

@camsteffen
Copy link
Contributor

Rustup updates clippy so it is expected that clippy behavior will change. The issue with the version number not changing is fixed in #6526. I don't think there is anything actionable here but let me know if I'm missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

No branches or pull requests

3 participants