Prefer patched versions of dependencies#9639
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon. Please see the contribution instructions for more information. |
|
Sorry for the tardy review! This looks exactly like what I had in mind, thank you! Looking it over I have 2 thoughts:
|
|
Sounds good! Maybe a followup to this would be some kind of VersionPreferences struct that abstracts away the version sort performed by the resolver? So that section would become I don't know why the cargo-fix test failed in my last push. I'll rebase in the process of making the changes you suggest, in hopes that it's been addressed on main since I branched. |
When selecting among several versions of a paackage, prefer versions from `[patch]` sections over other versions, similar to how locked versions are preferred. Patches come in the form of a Dependency and not a PackageId, so this preference is expressed with `prefer_patch_deps`, distinct from `try_to_use`.
|
This looks good! Thank you! |
|
📌 Commit bd4a353 has been approved by |
|
☀️ Test successful - checks-actions |
Update cargo 13 commits in 3ebb5f15a940810f250b68821149387af583a79e..66a6737a0c9f3a974af2dd032a65d3e409c77aac 2021-07-02 20:35:38 +0000 to 2021-07-14 20:54:28 +0000 - Add format option to `cargo tree` to print the lib_name (rust-lang/cargo#9663) - Prefer patched versions of dependencies (rust-lang/cargo#9639) - When a dependency does not have a version, git or path, fails directly (rust-lang/cargo#9686) - Spot the crate typo easily (rust-lang/cargo#9665) - remove unnecessary 'collect' (rust-lang/cargo#9616) - Make it easier to run testsuite with a custom toolchain. (rust-lang/cargo#9679) - Serialize `cargo fix` (rust-lang/cargo#9677) - Don't recommend filing issues on rust-lang/cargo for Cargo.toml errors. (rust-lang/cargo#9658) - Update nightly failure notification. (rust-lang/cargo#9657) - Update Windows env uppercase key check. (rust-lang/cargo#9654) - Unignore fix_edition_2021. (rust-lang/cargo#9662) - Warning when using features in patch (rust-lang/cargo#9666) - Unify cargo and rustc's error reporting (rust-lang/cargo#9655)
Update cargo 13 commits in 3ebb5f15a940810f250b68821149387af583a79e..66a6737a0c9f3a974af2dd032a65d3e409c77aac 2021-07-02 20:35:38 +0000 to 2021-07-14 20:54:28 +0000 - Add format option to `cargo tree` to print the lib_name (rust-lang/cargo#9663) - Prefer patched versions of dependencies (rust-lang/cargo#9639) - When a dependency does not have a version, git or path, fails directly (rust-lang/cargo#9686) - Spot the crate typo easily (rust-lang/cargo#9665) - remove unnecessary 'collect' (rust-lang/cargo#9616) - Make it easier to run testsuite with a custom toolchain. (rust-lang/cargo#9679) - Serialize `cargo fix` (rust-lang/cargo#9677) - Don't recommend filing issues on rust-lang/cargo for Cargo.toml errors. (rust-lang/cargo#9658) - Update nightly failure notification. (rust-lang/cargo#9657) - Update Windows env uppercase key check. (rust-lang/cargo#9654) - Unignore fix_edition_2021. (rust-lang/cargo#9662) - Warning when using features in patch (rust-lang/cargo#9666) - Unify cargo and rustc's error reporting (rust-lang/cargo#9655)
Update cargo 13 commits in 3ebb5f15a940810f250b68821149387af583a79e..66a6737a0c9f3a974af2dd032a65d3e409c77aac 2021-07-02 20:35:38 +0000 to 2021-07-14 20:54:28 +0000 - Add format option to `cargo tree` to print the lib_name (rust-lang/cargo#9663) - Prefer patched versions of dependencies (rust-lang/cargo#9639) - When a dependency does not have a version, git or path, fails directly (rust-lang/cargo#9686) - Spot the crate typo easily (rust-lang/cargo#9665) - remove unnecessary 'collect' (rust-lang/cargo#9616) - Make it easier to run testsuite with a custom toolchain. (rust-lang/cargo#9679) - Serialize `cargo fix` (rust-lang/cargo#9677) - Don't recommend filing issues on rust-lang/cargo for Cargo.toml errors. (rust-lang/cargo#9658) - Update nightly failure notification. (rust-lang/cargo#9657) - Update Windows env uppercase key check. (rust-lang/cargo#9654) - Unignore fix_edition_2021. (rust-lang/cargo#9662) - Warning when using features in patch (rust-lang/cargo#9666) - Unify cargo and rustc's error reporting (rust-lang/cargo#9655)
When selecting among several versions of a paackage, prefer versions
from
[patch]sections over other versions, similar to how lockedversions are preferred.
Patches come in the form of a Dependency and not a PackageId, so this
preference is expressed with
prefer_patch_deps, distinct fromtry_to_use.Fixes #9535