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

Build fails when rusqlite/git is used #22

Open
proofrock opened this issue Sep 18, 2023 · 2 comments
Open

Build fails when rusqlite/git is used #22

proofrock opened this issue Sep 18, 2023 · 2 comments

Comments

@proofrock
Copy link

Hi! Thank you for the library. I have a project that uses rusqlite and serde-rusqlite. If I use:

rusqlite = { version = "~0", features = ["serde_json"] }
serde_rusqlite = "~0"

All is well, but if I use the GIT version of rusqlite...

rusqlite = { git  = "https://github.com/rusqlite/rusqlite", features = ["serde_json"] }
serde_rusqlite = "~0"

It fails. If I remove serde_rusqlite, all is well again. I paste the error below; is there a way to fix this?

Thank you!

G.

error: failed to select a version for `libsqlite3-sys`.
    ... required by package `rusqlite v0.29.0`
    ... which satisfies dependency `rusqlite = "^0.29"` (locked to 0.29.0) of package `serde_rusqlite v0.33.1`
    ... which satisfies dependency `serde_rusqlite = "~0"` (locked to 0.33.1) of package `sqliterg v0.0.0 (/home/devel/sqliterg)`
versions that meet the requirements `^0.26.0` (locked to 0.26.0) are: 0.26.0

the package `libsqlite3-sys` links to the native library `sqlite3`, but it conflicts with a previous package which links to `sqlite3` as well:
package `libsqlite3-sys v0.26.0 (https://github.com/rusqlite/rusqlite#6176b11a)`
    ... which satisfies git dependency `libsqlite3-sys` of package `rusqlite v0.29.0 (https://github.com/rusqlite/rusqlite#6176b11a)`
    ... which satisfies git dependency `rusqlite` of package `sqliterg v0.0.0 (/home/devel/sqliterg)`
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 the links ='libsqlite3-sys' 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
make: *** [Makefile:21: build] Error 101
@twistedfall
Copy link
Owner

Can you please try crate version 0.34?

@proofrock
Copy link
Author

Hi! Sorry for the delay here. It basically gives the same error:

make build
cargo build --release
    Updating crates.io index
error: failed to select a version for `libsqlite3-sys`.
    ... required by package `rusqlite v0.30.0`
    ... which satisfies dependency `rusqlite = "^0.30"` of package `serde_rusqlite v0.34.0`
    ... which satisfies dependency `serde_rusqlite = "^0.34"` of package `sqliterg v0.17.1 (/home/devel/sqliterg)`
versions that meet the requirements `^0.27.0` are: 0.27.0

the package `libsqlite3-sys` links to the native library `sqlite3`, but it conflicts with a previous package which links to `sqlite3` as well:
package `libsqlite3-sys v0.27.0 (https://github.com/rusqlite/rusqlite#c2fbd167)`
    ... which satisfies git dependency `libsqlite3-sys` (locked to 0.27.0) of package `rusqlite v0.30.0 (https://github.com/rusqlite/rusqlite#c2fbd167)`
    ... which satisfies git dependency `rusqlite` (locked to 0.30.0) of package `sqliterg v0.17.1 (/home/devel/sqliterg)`
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 the links ='libsqlite3-sys' 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
make: *** [Makefile:36: build] Error 101

I think I see that you updated the dependency, it's a bit of cat-and-mouse game... I don't know rust enough to say if there's a way to say "latest possible version of a dependency"...

Anyway, if you don't mind, I took the relevant code from your project and incorporated in mine, it works like a charm, so thanks. How can I give proper attribution?

proofrock/sqliterg@3fde75e

I also used the same code in a project for DuckDB, it works flawslessly too, if you are interested in porting.

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

No branches or pull requests

2 participants