refactor(resolver): Consolidate logic in VersionPreferences#12930
Merged
bors merged 6 commits intorust-lang:masterfrom Nov 10, 2023
Merged
refactor(resolver): Consolidate logic in VersionPreferences#12930bors merged 6 commits intorust-lang:masterfrom
VersionPreferences#12930bors merged 6 commits intorust-lang:masterfrom
Conversation
Collaborator
|
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
VersionPreferences
This had repurcussions on direct-minimal-versions as it before relied on the ordering parameter to `sort_sumarries`.
3d00560 to
2c5ddc0
Compare
Eh2406
reviewed
Nov 8, 2023
| .unwrap_or(false) | ||
| }; | ||
| if self.max_rust_version.is_some() { | ||
| summaries.retain(|s| s.rust_version() <= self.max_rust_version.as_ref()); |
Contributor
There was a problem hiding this comment.
Should this still be called sort_summaries if it can remove versions?
Contributor
Author
There was a problem hiding this comment.
That name mismatch goes back to when I added -Zdirect-minimal-versions.
Have an idea for a better name?
Contributor
|
Looked this over and LGTM |
ehuss
reviewed
Nov 9, 2023
Contributor
|
r = me when you are ready. |
Contributor
Author
|
@bors r=Eh2406 |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
epage
added a commit
to epage/cargo
that referenced
this pull request
Nov 10, 2023
This is another experiment for rust-lang#9930. Comparing preferring over exclusively using MSRV compatible: Benefits - Better error messages - `--ignore-rust-version` is implicitly sticky Downsides - Can't backtrack for MSRV compatible version - Still requires workspace-wide MSRV (compared to our desired end state of declaring MSRV as yet another dependency) This builds on rust-lang#12930
epage
added a commit
to epage/cargo
that referenced
this pull request
Nov 10, 2023
This is another experiment for rust-lang#9930. Comparing preferring over exclusively using MSRV compatible: Benefits - Better error messages - `--ignore-rust-version` is implicitly sticky Downsides - Can't backtrack for MSRV compatible version - Still requires workspace-wide MSRV (compared to our desired end state of declaring MSRV as yet another dependency) This builds on rust-lang#12930
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 10, 2023
Update cargo 12 commits in 7046d992f9f32ba209a8079f662ebccf9da8de25..6790a5127895debec95c24aefaeb18e059270df3 2023-11-08 03:24:57 +0000 to 2023-11-10 17:09:35 +0000 - refactor(source): Prepare for new PackageIDSpec syntax (rust-lang/cargo#12938) - credential: include license files in all published crates (rust-lang/cargo#12953) - fix: preserve jobserver file descriptors on rustc invocation in `fix_exec_rustc` (rust-lang/cargo#12951) - refactor(resolver): Consolidate logic in `VersionPreferences` (rust-lang/cargo#12930) - refactor(toml): Simplify code to make schema split easier (rust-lang/cargo#12948) - Filter `cargo-credential-*` dependencies by OS (rust-lang/cargo#12949) - refactor(util): Pull out `mod util_semver` (rust-lang/cargo#12940) - Fix the invalidate feature name message (rust-lang/cargo#12939) - refactor(util): Prepare for splitting out semver logic (rust-lang/cargo#12926) - feat: Make browser links out of HTML file paths (rust-lang/cargo#12889) - Do not allow empty feature name (rust-lang/cargo#12928) - fix(timings): unnecessary backslash when error happens (rust-lang/cargo#12934) r? ghost
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 11, 2023
Update cargo 12 commits in 7046d992f9f32ba209a8079f662ebccf9da8de25..6790a5127895debec95c24aefaeb18e059270df3 2023-11-08 03:24:57 +0000 to 2023-11-10 17:09:35 +0000 - refactor(source): Prepare for new PackageIDSpec syntax (rust-lang/cargo#12938) - credential: include license files in all published crates (rust-lang/cargo#12953) - fix: preserve jobserver file descriptors on rustc invocation in `fix_exec_rustc` (rust-lang/cargo#12951) - refactor(resolver): Consolidate logic in `VersionPreferences` (rust-lang/cargo#12930) - refactor(toml): Simplify code to make schema split easier (rust-lang/cargo#12948) - Filter `cargo-credential-*` dependencies by OS (rust-lang/cargo#12949) - refactor(util): Pull out `mod util_semver` (rust-lang/cargo#12940) - Fix the invalidate feature name message (rust-lang/cargo#12939) - refactor(util): Prepare for splitting out semver logic (rust-lang/cargo#12926) - feat: Make browser links out of HTML file paths (rust-lang/cargo#12889) - Do not allow empty feature name (rust-lang/cargo#12928) - fix(timings): unnecessary backslash when error happens (rust-lang/cargo#12934) r? ghost
epage
added a commit
to epage/cargo
that referenced
this pull request
Nov 12, 2023
This is another experiment for rust-lang#9930. Comparing preferring over exclusively using MSRV compatible: Benefits - Better error messages - `--ignore-rust-version` is implicitly sticky Downsides - Can't backtrack for MSRV compatible version - Still requires workspace-wide MSRV (compared to our desired end state of declaring MSRV as yet another dependency) This builds on rust-lang#12930
epage
added a commit
to epage/cargo
that referenced
this pull request
Nov 13, 2023
This is another experiment for rust-lang#9930. Comparing preferring over exclusively using MSRV compatible: Benefits - Better error messages - `--ignore-rust-version` is implicitly sticky Downsides - Can't backtrack for MSRV compatible version - Still requires workspace-wide MSRV (compared to our desired end state of declaring MSRV as yet another dependency) This builds on rust-lang#12930
epage
added a commit
to epage/cargo
that referenced
this pull request
Nov 13, 2023
This is another experiment for rust-lang#9930. Comparing preferring over exclusively using MSRV compatible: Benefits - Better error messages - `--ignore-rust-version` is implicitly sticky Downsides - Can't backtrack for MSRV compatible version - Still requires workspace-wide MSRV (compared to our desired end state of declaring MSRV as yet another dependency) This builds on rust-lang#12930
epage
added a commit
to epage/cargo
that referenced
this pull request
Nov 14, 2023
This is another experiment for rust-lang#9930. Comparing preferring over exclusively using MSRV compatible: Benefits - Better error messages - `--ignore-rust-version` is implicitly sticky Downsides - Can't backtrack for MSRV compatible version - Still requires workspace-wide MSRV (compared to our desired end state of declaring MSRV as yet another dependency) This builds on rust-lang#12930
bors
added a commit
that referenced
this pull request
Nov 14, 2023
fix(resolver): Prefer MSRV, rather than ignore incompatible ### What does this PR try to resolve? This is another experiment for #9930. Comparing preferring over exclusively using MSRV compatible: Benefits - Better error messages - `--ignore-rust-version` is implicitly sticky Downsides - Can't backtrack for MSRV compatible version - Still requires workspace-wide MSRV (compared to our desired end state of declaring MSRV as yet another dependency) ### How should we test and review this PR? ### Additional information Note: `--ignore-rust-version` is not yet implemented for the resolver. This builds on #12930
linyihai
pushed a commit
to linyihai/cargo
that referenced
this pull request
Nov 17, 2023
This is another experiment for rust-lang#9930. Comparing preferring over exclusively using MSRV compatible: Benefits - Better error messages - `--ignore-rust-version` is implicitly sticky Downsides - Can't backtrack for MSRV compatible version - Still requires workspace-wide MSRV (compared to our desired end state of declaring MSRV as yet another dependency) This builds on rust-lang#12930
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
This makes customizing the resolver less intrusive by putting the logic in
VersionPreferencesand making it easy to add new priority cases to it.In particular, this is prep for tweaking the MSRV resolver to prefer compatible versions, rather than require them.
See https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Alternative.20MSRV-aware.20resolver.20approach.3F
How should we test and review this PR?
Each step is broken down into its own commit for easier browsing
Additional information