-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
cargo add selects versions of native dependencies which are not compatible with transitive packages #11948
Comments
|
Ah, that makes sense. I believed It seems that
|
This somewhat reminds me of the problem of public/private dependencies. One overall complication is how to decide to walk the dependency tree. I feel like we'd need to walk the dependency tree, enumerating |
Problem
Originally reported in diesel-rs/diesel#3587
The issue here is that diesel depends on libsqlite3-sys, which is a native dependency and declares that it links to
sqlite3
. If the crate being added to gets a direct dependency to libsqlite3-sys (something which is needed to activate features in it that are not re-exported by diesel) this can causecargo add
to potentially select an incompatible version.Steps
If you run
cargo add libsqlite3-sys
on a manifest with the following:It results in the following error:
Note: The same issue applies to
cargo upgrade
, which comes from thecargo-edit
project for which this issue was originally reported.Possible Solution(s)
Cargo could opt to only upgrade to versions of libsqlite3-sys which are compatible. That means it would have to analyze linking restrictions when selecting a new version.
Cargo could also opt to allow the activation of transitive features. I'm sure that's been discussed somewhere but I can't find it right now.
Note that there's also the option for the transitive crate to re-export the desired feature, but in the case of
diesel
the maintainer is unwilling to do so.Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered: