Description
Bug Description
SQLx doesn't seem to play nicely with rusqlite even when not using the sqlite feature.
I'd expect to be able to use rusqlite instead of the sqlx 'sqlite' (for various reasons unrelated to whether it is better or not).
Minimal Reproduction
Demonstration:
- Clone the repo: https://github.com/BSteffaniak/sqlx-demo
cargo build
- Notice that it succeeds
- Uncomment the commented out the sqlx dependency version that has the
chrono
feature enabled in theCargo.toml
cargo build
- Notice that now it fails with an error message resembling the following:
error: failed to select a version for
libsqlite3-sys
.
... required by packagesqlx-sqlite v0.8.0
... which satisfies dependencysqlx-sqlite = "=0.8.0"
of packagesqlx v0.8.0
... which satisfies dependencysqlx = "^0.8.0"
(locked to 0.8.0) of packagesqlx-demo v0.1.0 (/home/bsteffaniak/GitHub/Sqlx-demo)
versions that meet the requirements^0.28.0
are: 0.28.0the package
libsqlite3-sys
links to the native librarysqlite3
, but it conflicts with a previous package which links tosqlite3
as well:
packagelibsqlite3-sys v0.30.0
... which satisfies dependencylibsqlite3-sys = "^0.30.0"
(locked to 0.30.0) of packagerusqlite v0.32.0
... which satisfies dependencyrusqlite = "^0.32.0"
(locked to 0.32.0) of packagesqlx-demo v0.1.0 (/home/bsteffaniak/GitHub/Sqlx-demo)
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses thelinks = "sqlite3"
value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.failed to select a version for
libsqlite3-sys
which could resolve this conflict
Am I understanding something incorrectly about how nested dependencies should work?
Thanks!
Info
- SQLx version: 0.8.0
- SQLx features enabled: "chrono"
- Database server and version: postgres 0.8.0
- Operating system: Debian
rustc --version
: rustc 1.79.0 (129f3b996 2024-06-10)