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

fix: Consistently compare MSRVs #13537

Merged
merged 4 commits into from
Mar 8, 2024
Merged

fix: Consistently compare MSRVs #13537

merged 4 commits into from
Mar 8, 2024

Conversation

epage
Copy link
Contributor

@epage epage commented Mar 5, 2024

What does this PR try to resolve?

Currently, we use several strategies to evaluate an MSRV

  • Relying in impl Ord for RustVersion (dep_msrv <= pkg_msrv)
  • Converting to version requirements
    • Decrementing a version

This consolidates around one strategy: RustVersion::is_compatible_with

  • Ensure the comparisons have the same behavior
  • Centralize knowledge of how to handle pre-release rustc
  • Losslessly allow comparing with either rustc or workspace msrv

How should we test and review this PR?

Refactors are split out

I didn't go through and verify if or how the different approaches varied in behavior, instead consolidating on the one, so only unit tests around the consolidated behavior were added rather than trying to hit all of the corner cases within the various ways RustVersion is used.

Additional information

We used several strategies
- Relying in `impl Ord for RustVersion`
- Converting to version requirements
  - Decrementing a version

This consolidates around one strategy: `RustVersion::is_compatible_with`
- Ensure the comparisons have the same behavior
- Centralize knowledge of how to handle pre-release rustc
- Losslessly allow comparing with either rustc or workspace msrv
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2024

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-dependency-resolution Area: dependency resolution and the resolver A-manifest Area: Cargo.toml issues Command-add Command-install S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 5, 2024
@rustbot rustbot added the A-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc. label Mar 5, 2024
@Eh2406
Copy link
Contributor

Eh2406 commented Mar 5, 2024

Looks like a good simplification.

@epage epage force-pushed the msrv-compat branch 2 times, most recently from 84810fe to 134ed93 Compare March 7, 2024 17:40
@Eh2406
Copy link
Contributor

Eh2406 commented Mar 8, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 8, 2024

📌 Commit 134ed93 has been approved by Eh2406

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 Mar 8, 2024
@bors
Copy link
Contributor

bors commented Mar 8, 2024

⌛ Testing commit 134ed93 with merge 29cf016...

@bors
Copy link
Contributor

bors commented Mar 8, 2024

☀️ Test successful - checks-actions
Approved by: Eh2406
Pushing 29cf016 to master...

@bors bors merged commit 29cf016 into rust-lang:master Mar 8, 2024
21 checks passed
@epage epage deleted the msrv-compat branch March 8, 2024 19:52
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 12, 2024
Update cargo

9 commits in a4c63fe5388beaa09e5f91196c86addab0a03580..7065f0ef4aa267a7455e1c478b5ccacb7baea59c
2024-03-06 22:15:17 +0000 to 2024-03-12 13:25:15 +0000
- chore: remove repetitive word (rust-lang/cargo#13575)
- refactor(lockfile): Make diffing/printing more reusable (rust-lang/cargo#13564)
- test: Add tests for using worktrees and sparse checkouts (rust-lang/cargo#13567)
- util/network/http: Use `cargo/1.2.3` user-agent header (rust-lang/cargo#13548)
- fix: Consistently compare MSRVs (rust-lang/cargo#13537)
- refactor(shell): Use alternate to close links (rust-lang/cargo#13562)
- fix(doc): Collapse down Generated statuses without --verbose (rust-lang/cargo#13557)
- doc: Add doc for -Zpublic-dependency (rust-lang/cargo#13556)
- docs: add link to the exported_private_dependencies lint (rust-lang/cargo#13547)

r? ghost
@rustbot rustbot added this to the 1.78.0 milestone Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependency-resolution Area: dependency resolution and the resolver A-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc. A-manifest Area: Cargo.toml issues Command-add Command-install 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.

5 participants