Skip to content

Duplicate links attribute check should not count unused optional dependencies #9324

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

Closed
toyboot4e opened this issue Apr 3, 2021 · 1 comment
Labels
C-bug Category: bug

Comments

@toyboot4e
Copy link

Problem

cargo build fails if Cargo.toml has two different sys crates that link to the same C library:

[dependencies]
# they both link to `OurLibrary`
sys-crate-A = { version = "..", optional = true }
sys-crate-B = { version = "..", optional = true }

..even if one (or none) of them are used.

cargo build says as this:

the package `sys-crate-B` links to the native library `OurLibrary`, but it conflicts with a previous package which links to `sys-crate-A` as well:

Possible Solution(s)

Unused optional crates should be excluded from the duplicate links attribute check. I guess.

Notes

This repository contains concreate example and full error message. Thank you.

@toyboot4e toyboot4e added the C-bug Category: bug label Apr 3, 2021
@toyboot4e
Copy link
Author

Excuse me.. it was duplicate of #6231 and such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

1 participant