Skip to content
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

specifying different versions in unconditional and target-specific dependency sections causes "multiple rmeta candidates" error #8032

Open
sunshowers opened this issue Mar 23, 2020 · 0 comments
Labels
A-crate-dependencies Area: [dependencies] of any kind A-diagnostics Area: Error and warning messages generated by Cargo itself. A-target-dependencies Area: [target.'cfg(foo)'.dependencies] C-bug Category: bug S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@sunshowers
Copy link
Contributor

sunshowers commented Mar 23, 2020

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.

@sunshowers sunshowers added the C-bug Category: bug label Mar 23, 2020
@ehuss ehuss added A-crate-dependencies Area: [dependencies] of any kind A-target-dependencies Area: [target.'cfg(foo)'.dependencies] labels Mar 24, 2020
@epage epage added A-diagnostics Area: Error and warning messages generated by Cargo itself. S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. labels Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-crate-dependencies Area: [dependencies] of any kind A-diagnostics Area: Error and warning messages generated by Cargo itself. A-target-dependencies Area: [target.'cfg(foo)'.dependencies] C-bug Category: bug S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

3 participants