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

Multiple packages link to native library sqlite3 #1703

Closed
hanckmann opened this Issue May 18, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@hanckmann

hanckmann commented May 18, 2018

Versions

  • Rust: rustc 1.27.0-nightly (2f2a11dfc 2018-05-16) / cargo 1.27.0-nightly (9e53ac6e6 2018-05-07)
  • Diesel: 0.16.0 / 1.2.2 (not sure, both are in the Cargo.lock)
  • Database: sqlite
  • Operating System Mac OSX

Feature Flags

  • diesel: cargo install diesel_cli --no-default-features --features "sqlite"
    [dependencies]
    ...
    diesel = { version = "1.0.0", features = ["sqlite"] }
    diesel_codegen = { version = "*", features = ["sqlite"] }

Problem Description

The build failes with the following message:

λ ~/Projects/zen-api/ master* cargo build
error: multiple packages link to native library sqlite3, but a native library can be linked only once

package libsqlite3-sys v0.9.1
... which is depended on by diesel v1.2.2
... which is depended on by zen-api v0.1.0 (file:///Users/patrick/Projects/zen-api)
links to native library sqlite3

package libsqlite3-sys v0.8.1
... which is depended on by diesel v0.16.0
... which is depended on by diesel_infer_schema v0.16.0
... which is depended on by diesel_codegen v0.16.0
... which is depended on by zen-api v0.1.0 (file:///Users/patrick/Projects/zen-api)
also links to native library sqlite3

What are you trying to accomplish?

I am using diesel with rocket and serde. Basically following this tutorial: https://medium.com/sean3z/building-a-restful-crud-api-with-rust-1867308352d8
The only thing I fundamentally changed is the database, as I am using sqlite. My db.rs is taken from: https://github.com/SergioBenitez/Rocket/blob/d4e590af83097c275e76550950156e9ce30a048f/examples/todo/src/db.rs
and: https://github.com/SergioBenitez/Rocket/blob/d4e590af83097c275e76550950156e9ce30a048f/examples/todo/src/main.rs

What is the expected output?

I expect the code to compile.

What is the actual output?

The error as presented above.

Are you seeing any additional errors?

Nope

Steps to reproduce

I do not mind to share my code. However, I doubt the usefullness of doing this at this moment. I guess this is a relatively easy question for you... for me... these are my first steps into rust (and hence into diesel). If the codebase does help, please let me know and I will send it.

Also, I am not sure why I require nightly (the tutorial tells me to do so). Could the issue be in this part?

@weiznich

This comment has been minimized.

Contributor

weiznich commented May 18, 2018

diesel_codegen is dead since diesel 0.99. So do not use it!
See the changelog for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment