-
Notifications
You must be signed in to change notification settings - Fork 224
Let clippy check MSRV #7069
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
Let clippy check MSRV #7069
Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. |
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.
I'm a little wary, because it's nice for us to say "we know we build on MSRV", whereas I would not trust Clippy to be 100% correct when it comes to stuff like this. Especially when macros/etc are involved.
I am okay with getting rid of msrv-utils and trusting Clippy for that part. I just don't want to get rid of the MSRV job. |
let's set the toolchain in the GHA job then, so that locally it doesn't use a different toolchain, and so that this job also uses beta and nightly in CI |
I like that! |
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.
Still a little concerned about increasing the number of CI-specific things that are not accessible via the makefile. I have a suggestion.
- `ci-job-msrv-check`: Runs `cargo check` on all the crates at our minimum supported Rust version (MSRV). | ||
- `ci-job-msrv-features`: Runs `cargo check-all-features` on all the crates at our MSRV. This checks all features combinations, which is fairly slow. | ||
- `ci-job-check`: Runs `cargo check` on all the crates. | ||
- `ci-job-features`: Runs `cargo check-all-features` on all the crates. This checks all features combinations, which is fairly slow. |
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.
issue: So ci-job-foo
is intended to, as much as possible, match what happens in CI; so that you can replicate CI failures locally without having to go spelunking in GHA setup files.
I think we should have ci-job-msrv-features
(or whatever), and internally it sets the toolchain and calls some named task like check-all-features
or ci-job-features
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.
I like that!
so you don't like that after all?
If the features CI job fails, clippy will also fail, except in the very unlikely case where that MSRV issue is a false negative in clippy. fixing clippy will fix the features job as well, so there isn't really any spelunking necessary.
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.
I didn't fully understand the specific approach being proposed in that comment. What I am proposing also matches that comment I think: I'm proposing an underlying makefile task for local invocation, distinct from
That said, I don't consider "get MSRV from CI" to be too much spelunking (if the MSRV job fails, you probably should set MSRV when testing locally, that's obvious), and we've never had perfect replicability. So I don't consider this blocking.
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.
I trust @Manishearth to make sure this works. Please make sure that:
- We still test MSRV in CI. It sounds like that means building with MSRV, not just asking Clippy to check for us.
- Specific crates can continue to opt-out of global MSRV and use their own, and this is also tested in CI.
Yes, I asked that the MSRV job still do this: it explicitly sets the MSRV first.
this part is now handled by the clippy check. I think that's overall fine, personally? We could revive the |
I have been the delegate who pushes most strongly for strict MSRV conformance, so my prior is to not make the check weaker, but I trust you both to make a good decision here that complies with previous TC consensus on supporting older MSRVs for specific utils crates. |
@sffc I'm actually deferring to you on the I think it's mostly fine to use the clippy check for the older util MSRV, but lints can have false negatives. Here's most of the information you need:
The nice thing about the clippy check is that it's automatic and we don't have to do additional steps to decouple util MSRV from ICU4X MSRV, it's just the Cargo.toml rust-version change. I think a lower barrier for playing with util MSRV is great. |
I don't understand what changes you guys want |
@robertbastian the change in my issue above is an optional one where:
This way running Again, this is optional. Regarding msrv-utils: I don't think there's a requested change yet. This PR replaces |
so no action on my end, just an approval from @sffc? |
Correct. |
And Shane can use the contents of this comment to provide his opinion: #7069 (comment) |
If we're fairly confident that we can always undo MSRV breakages via patch releases, then relying on the clippy check seems fine when scoped to smaller crates like zerofrom. I would worry that a more complex crate like yoke or zerovec might have problems that slip through and might not be easy to undo. For example, things like GATs are evolving, and we could end up in a situation where we rely on a GAT feature that Clippy doesn't catch.
Yes, this is a really nice benefit. |
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.
Okay, in that case @robertbastian go ahead and merge.
Perhaps we can resurrect msrv-utils as a smarter CI task that doesn't require setting things in the CI file.
#7068