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

Version conflict #2255

Closed
martinellison opened this issue Dec 23, 2019 · 3 comments
Closed

Version conflict #2255

martinellison opened this issue Dec 23, 2019 · 3 comments

Comments

@martinellison
Copy link

martinellison commented Dec 23, 2019

I am getting a version conflict in a project that uses diesel:

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.4.3
... which is depended on by [my code]
links to native library sqlite3

package libsqlite3-sys v0.17.0
... which is depended on by rusqlite v0.21.0
... which is depended on by [my code]
also links to native library sqlite3

Setup

Versions

  • Rust: rustc 1.40.0 (73528e339 2019-12-16)
  • Diesel: 1.4.3
  • Database: sqlite3 3.30.0 2019-10-04 15:03:17 c20a35336432025445f9f7e289d0cc3e4003fb17f45a4ce74c6269c407c6alt1
  • Operating System Linux xiaosan 5.3.16-300.fc31.x86_64 TODO #1 SMP Fri Dec 13 17:59:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Feature Flags

  • diesel: diesel = { version = "1.4.3", features = ["sqlite", "chrono"] }

Problem Description

Does not build

Checklist

  • [x ] I have already looked over the issue tracker for similar issues.
  • [ x] This issue can be reproduced on Rust's stable channel. (Your issue will be
    closed if this is not the case)
@weiznich
Copy link
Member

As the error messages says you cannot link multiple versions of a native library. Seems like rusqlite uses a newer version of libsqlite3-sys than diesel. You need to find a version that is supported by both.

@lnicola
Copy link

lnicola commented Dec 25, 2019

@weiznich This comes up every so often. libsqlite3-sys releases didn't seem to introduce problems in the past, and diesel is pretty slow at releasing new versions and updating dependencies. How would you feel about removing the upper version bound and just using libsqlite3-sys = "0.8"?

@weiznich
Copy link
Member

@lnicola A few comments here:

  • Just using libsqlite3-sys = "0.8" wont solve the issue. That means use any version that is compatible with 0.8.0 which means use any version 0.8.x in the end. (Cargo does not consider 0.8.0 and 0.9.0 as compatible.)
  • Using libsqlite3-sys = ">=0.8" is also a bad idea because that means cargo will just use any newer version. Newer version likely contain breaking changes, therefore the "major" version bump. Diesel is not necessarily affected by this, because we do not use everything in this crate, but we had such cases (for example Remove support for libsqlite3-sys 0.10.0 #1925) in the past. You cannot say this without having tested this locally and at least I do not want to support something like that.
  • Building up at this: Diesel already supports multiple versions of libsqlite3. So if that's so easy why does rusqlite only support the latest release and not a version range like diesel? Or to ask this in another way: Why exactly is this a problem with diesel and not with rusqlite or the users own crate?
  • About updating dependencies and releasing new versions in general:
    • A new version of an dependency does not necessarily add something meaningful to diesel in my opinion. So updating a dependency is just work without a benefit in some cases (at least for me). If someone else want's to do this, sure go open a PR and we will try to find some time to review it.
    • We need to respect our stability guarantees, which means don't break old code. So if an updated dependency would require us to remove support for old versions of this crate we cannot do this (at least as long as the crate is part of the public API, like libsqlite3-sys or for example uuid and not without a major version bump. Just doing a dependency update is not a reason to do a major version bump in my opinion.)
    • Backporting PR's and doing a release is a nontrivial amount of work. I tend to do this only if I require a new release by myself. If anyone else needs a new point release go and open a PR targeting the right branch which backports the needed PR's (Looking for the maybe-backport label helps here) and writes a corresponding changelog entry.

So in the end all of this boils down to the following point: At least I do not have that much time to update all dependencies instantly. I tend to use my time for features I need myself in other projects. If someone requires urgently, they should consider either to contribute to diesel by first asking how to solve that (or telling someone that they are working on this feature/issue/whatever) or consider to pay someone (for example Sean) to work on that.

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

3 participants