-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
A-crate-dependenciesArea: [dependencies] of any kindArea: [dependencies] of any kindA-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.A-target-dependenciesArea: [target.'cfg(foo)'.dependencies]Area: [target.'cfg(foo)'.dependencies]C-bugCategory: bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Description
Problem
In a situation like:
[dependencies]
lazy_static = "1"
[target.'cfg(not(windows))'.dependencies]
lazy_static = "0.2"
cargo tries to include both lazy_static libraries, which fails with a "multiple rmeta candidates" error because it can't pick the right library.
Steps
git clone https://github.com/sunshowers/cargo-bug-multiversion
cd cargo-bug-multiversion
cargo doc
or uncomment the line in src/lib.rs then run cargo build.
Possible Solution(s)
Ideally this situation would be detected by cargo, at least when it notices that it's about to put multiple conflicting library paths in the same command.
I guess this is similar to the whole specialization issue in Rust, so if we wawnt to get fancy enough maybe non-overlapping specializations could be allowed?
Notes
Output of cargo version:
cargo 1.42.0 (86334295e 2020-01-31)
This is with the standard rustup stable toolchain on MacOS.
Metadata
Metadata
Assignees
Labels
A-crate-dependenciesArea: [dependencies] of any kindArea: [dependencies] of any kindA-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.A-target-dependenciesArea: [target.'cfg(foo)'.dependencies]Area: [target.'cfg(foo)'.dependencies]C-bugCategory: bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.