-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Don't squash path dependencies with same package name #13863
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.lock
was 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.