-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Remove metadata dep_kinds duplicates. #7756
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
let mut dep_kinds: Vec<_> = deps.iter().map(DepKindInfo::from).collect(); | ||
// Duplicates may appear if the same package is used by different | ||
// members of a workspace with different features selected. | ||
dep_kinds.dedup(); |
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.
The vec needs to be sorted for dedup to work properly.
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.
Oops, thanks!
6049f54
to
7acf376
Compare
@bors: r+ |
📌 Commit 7acf376 has been approved by |
Remove metadata dep_kinds duplicates. In `cargo metadata`, an entry could appear multiple times in the `dep_kinds` array if it is used by multiple workspace members with different features activated. This fixes it by de-duplicating the entries. This is kinda related to `cargo metadata` not handling workspaces and features very well. But workspaces and features are a bit awkward overall. Fixes #7752
☀️ Test successful - checks-azure |
Update cargo 9 commits in 86134e7666a088682f20b76278c3ee096a315218..6e1ca924a67dd1ac89c33f294ef26b5c43b89168 2019-12-23 16:08:07 +0000 to 2020-01-06 19:11:37 +0000 - Fix dynamic linking for Windows UWP MSVC targets (rust-lang/cargo#7758) - Fix CARGO_TARGET_triple_LINKER environment variable. (rust-lang/cargo#7763) - Remove metadata dep_kinds duplicates. (rust-lang/cargo#7756) - Check for a source defined multiple times. (rust-lang/cargo#7751) - Fix typo. (rust-lang/cargo#7735) - Fix config env vars that are prefix of another with underscore. (rust-lang/cargo#7748) - Add test for `cargo pkgid` (rust-lang/cargo#7741) - Add a note to the error message for using --feature / --no-default-features in a virtual workspace (rust-lang/cargo#7742) - Fix debug message. (rust-lang/cargo#7749)
In
cargo metadata
, an entry could appear multiple times in thedep_kinds
array if it is used by multiple workspace members with different features activated. This fixes it by de-duplicating the entries.This is kinda related to
cargo metadata
not handling workspaces and features very well. But workspaces and features are a bit awkward overall.Fixes #7752