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

Add MSRV validation GitHub Action for cargo-credential #12623

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

arlosi
Copy link
Contributor

@arlosi arlosi commented Sep 5, 2023

cargo-credential should have a separate MSRV from the rest of Cargo that is more relaxed.

@rustbot
Copy link
Collaborator

rustbot commented Sep 5, 2023

r? @weihanglo

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc. A-registry-authentication Area: registry authentication and authorization (authn authz) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 5, 2023
@epage
Copy link
Contributor

epage commented Sep 5, 2023

FYI I'm working on features for cargo-hack so you can run cargo hack check --rust-version and it will verify MSRV for all crates individually to help the scaling problem.

@epage
Copy link
Contributor

epage commented Sep 5, 2023

(don't feel like you need to wait on this work for this PR)

@arlosi arlosi marked this pull request as ready for review September 6, 2023 04:02
@weihanglo
Copy link
Member

Looks good. Thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 6, 2023

📌 Commit a900742 has been approved by weihanglo

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 6, 2023
@bors
Copy link
Collaborator

bors commented Sep 6, 2023

⌛ Testing commit a900742 with merge 73d9081...

@bors
Copy link
Collaborator

bors commented Sep 6, 2023

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing 73d9081 to master...

@bors bors merged commit 73d9081 into rust-lang:master Sep 6, 2023
20 checks passed
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 9, 2023
Update cargo

14 commits in d14c85f4e6e7671673b1a1bc87231ff7164761e1..2fc85d15a542bfb610aff7682073412cf635352f
2023-09-05 22:28:10 +0000 to 2023-09-09 01:49:46 +0000
- feat: Stabilize lints (rust-lang/cargo#12648)
- Ues strip_prefix for cleaner code (rust-lang/cargo#12631)
- fix: don't print _TOKEN suggestion when not applicable (rust-lang/cargo#12644)
- Bump cargo-credential-1password to v0.4.0 (rust-lang/cargo#12641)
- refactor: put `Source` trait under `cargo::sources` (rust-lang/cargo#12527)
- Error out if `cargo clean --doc` is mixed with `-p`. (rust-lang/cargo#12637)
- Add wrappers around std::fs::metadata (rust-lang/cargo#12636)
- Add with_stdout_unordered. (rust-lang/cargo#12635)
- Fix example for creating a git project test. (rust-lang/cargo#12632)
- Read/write the encoded `cargo update --precise` in the same place (rust-lang/cargo#12629)
- docs(guide): Apply feedback on CI (rust-lang/cargo#12630)
- fix: improve warning for both token & credential-provider (rust-lang/cargo#12626)
- Skip clean up `profile.release.package."*"` (rust-lang/cargo#12624)
- Add MSRV validation GitHub Action for cargo-credential (rust-lang/cargo#12623)
@ehuss ehuss added this to the 1.74.0 milestone Sep 30, 2023
bors added a commit that referenced this pull request Oct 8, 2023
Set and verify all MSRVs in CI

### What does this PR try to resolve?

Allow us to advertise an MSRV for all public packages, unblocking #12432.

Packages are broken down into two MSRV policies
- Internal packages: `rust-version=stable`
- Public packages: `rust-version=stable-2`

To support this
- RenovateBot will automatically update all MSRVs
- CI will verify all packages build according to their MSRV

Since this takes the "single workspace" approach, the downside is that common dependencies are subject to each package's MSRV.  We also can't rely on `-Zmsrv-policy` to help us generate a lockfile because it breaks down when trying to support multiple MSRVs in a workspace

### How should we test and review this PR?

Per commit

### Additional information

#12381 skipped setting some MSRVs because we weren't sure how to handle it.  For `cargo-credential`, we needed to do something and did one-off verification (#12623).  `cargo-hack` recently gained the ability to automatically select MSRVs for each package allowing us to scale this up to the entire workspace.

I don't know if we consciously chose an MSRV policy for `cargo-credential` but it looked like N-2 so that is what I stuck with and propagated out.
- Without an aggressive sliding MSRV, we discourage people from using newer features because they will feel like they need permission which means it needs to be justified
- Without an aggressive sliding MSRV, if the MSRV at one point in time works for someone, they tend to assume it will always work, leading to frustration at unmet expectations.

I switched the MSRV check to `cargo check` from `cargo test` because I didn't want to deal with the out-of-diskspace issues and `check` will catch 99% of MSRV issues.

Potential future improvements to `cargo-hack`
- Allow `--version-range ..stable` so we can verify all MSRVs that aren't stable which would bypass the diskspace issues and allow us to more easily use `cargo test` again
- Verify on a `cargo package` version of a crate (taiki-e/cargo-hack#216)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc. A-registry-authentication Area: registry authentication and authorization (authn authz) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants