Don't squash path dependencies with same package name#13863
Don't squash path dependencies with same package name#13863ldm0 wants to merge 2 commits intorust-lang:masterfrom
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @weihanglo (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
| .find(|package_id| { | ||
| package_id.version().cmp_precedence(&pkg_version) == std::cmp::Ordering::Equal | ||
| }) | ||
| .or_else(|| versions.last()) |
There was a problem hiding this comment.
Use last() for behaviour consistency with old cargo. Old cargo use HashMap and insert for path deps construction, therefore the last inserted package was picked.
4787160 to
b451f15
Compare
|
Note: I just did a quick scan of the issue (and commit structure). I've not looked at the test or code change in detail yet |
feb39cf to
6ef2209
Compare
|
It seems that CI failure is caused by |
|
ping @weihanglo |
|
☔ The latest upstream changes (presumably #13931) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Sorry for the late reply. Thought epage was on it. Feel free to open a new one whenever ready. |
Fixes #13862
Dependencies with same package name in the
Cargo.lockwas squashed inEncodableResolve::into_resolve().e.g. In the problem reproduction repo's Cargo.lock, there are two entries:
However, they were squashed in
build_path_deps(), then we endup getting two package ids with same path like this:This package version inconsistency triggers patch update introduced in #8248 everytime you compile this crate.