cargo
cargo copied to clipboard
Don't squash path dependencies with same package name
Fixes #13862
Dependencies with same package name in the Cargo.lock was squashed in EncodableResolve::into_resolve().
e.g. In the problem reproduction repo's Cargo.lock, there are two entries:
[[package]]
name = "once_cell"
version = "0.1.0"
[[package]]
name = "once_cell"
version = "1.19.0"
However, they were squashed in build_path_deps(), then we endup getting two package ids with same path like this:
PackageId { name: "once_cell", version: "0.1.0", source: "pwd/vendor/once_cell_1_19" }
PackageId { name: "once_cell", version: "1.19.0", source: "pwd/vendor/once_cell_1_19" }
This package version inconsistency triggers patch update introduced in https://github.com/rust-lang/cargo/pull/8248 everytime you compile this crate.
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 (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:
@rustbot author: the review is finished, PR author should check the comments and take action accordingly@rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
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
It seems that CI failure is caused by check-cfg https://github.com/rust-lang/cargo/actions/runs/8964218728/job/24615675343?pr=13863
Related: https://github.com/rust-lang/cargo/pull/13571
ping @weihanglo
:umbrella: 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.