Skip to content

Raise libsqlite3-sys dependency from 0.30 to 0.31 #3844

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dtolnay
Copy link

@dtolnay dtolnay commented Apr 25, 2025

This makes it possible to use sqlx and the most recent versions of the cargo crate in the same dependency graph. Cargo depends on rusqlite 0.33 which uses libsqlite3-sys 0.31. Without this PR, this dependency graph doesn't work.

error: failed to select a version for `libsqlite3-sys`.
    ... required by package `sqlx-sqlite v0.8.5`
    ... which satisfies dependency `sqlx-sqlite = "=0.8.5"` of package `sqlx v0.8.5`
    ... which satisfies dependency `sqlx = "^0.8.5"` of package `repro v0.0.0`
versions that meet the requirements `^0.30.1` are: 0.30.1

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.31.0`
    ... which satisfies dependency `libsqlite3-sys = "^0.31.0"` of package `rusqlite v0.33.0`
    ... which satisfies dependency `rusqlite = "^0.33.0"` of package `cargo v0.87.1`
    ... which satisfies dependency `cargo = "^0.87"` of package `repro v0.0.0`
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 = "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

Is this a breaking change?

The libsqlite3-sys update: no, previous precedent is that these are semver-exempt and anyone using libsqlite3-sys through some other dependency needs to have pinned their sqlx version and be updating in lockstep.

sqlx/CHANGELOG.md

Lines 888 to 890 in 91d26ba

* Alongside this upgrade, we are now considering the linkage to `libsqlite3-sys` to be **semver-exempt**,
and we reserve the right to upgrade it as necessary. If you are using `libsqlite3-sys` directly or a crate that
links it such as `rusqlite`, you should pin the versions of both crates to avoid breakages from `cargo update`:

However, for this specific update, libsqlite3-sys requires a version of bindgen that only supports Rust 1.82+, and sqlx considers this a breaking change.

sqlx/FAQ.md

Lines 23 to 24 in 91d26ba

SQLx's MSRV is the second-to-latest stable release as of the beginning of the current release cycle (`0.x.0`).
It will remain there until the next major release (`0.{x + 1}.0`).

If a new major version of sqlx is not imminent, I am still interested in libsqlite3-sys 0.31 in sqlx 0.8 and can make it not a breaking change by improving bindgen to generate Rust 1.78-compatible code when run by a toolchain older than 1.82.

dtolnay added 2 commits April 25, 2025 15:09
This is required by bindgen 0.71, which is used by libsqlite3-sys 0.31.

    error: extern block cannot be declared unsafe
       --> target/debug/build/libsqlite3-sys-3da8b75ff8e55f52/out/bindgen.rs:521:1
        |
    521 | unsafe extern "C" {
        | ^^^^^^
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

Successfully merging this pull request may close these issues.

1 participant