SeaQL / sea-query

🔱 A dynamic SQL query builder for MySQL, Postgres and SQLite
https://www.sea-ql.org
Other
1.2k stars 194 forks source link

`sea-query-binder` links to `sqlite3` conflict #823

Open mattrighetti opened 1 month ago

mattrighetti commented 1 month ago

This seems to be broken: https://github.com/SeaQL/sea-query/blob/d94f386c36c0afa910b611fbfb1004ccad684216/examples/sqlx_sqlite/Cargo.toml#L27-L29

I've tested this within the examples/sqlx_example folder with the following Cargo.toml

[workspace]
# A separate workspace

[package]
name = "sea-query-sqlx-sqlite-example"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
time = { version = "0.3.36", features = ["macros"] }
uuid = { version = "1", features = ["serde", "v4"] }
serde_json = "1"
async-std = { version = "1.8", features = [ "attributes" ] }
sqlx = "0.8"
sea-query = { version = "0" }
sea-query-binder = { version = "0", features = [
    "sqlx-sqlite",
    "with-chrono",
    "with-json",
    "with-uuid",
    "with-time",
    "runtime-async-std-native-tls",
] }

file and I get this error

$ cargo build
error: failed to select a version for `sea-query-binder`.
    ... required by package `sea-query-sqlx-sqlite-example v0.1.0 (/Users/mattrighetti/Developer/sea-query/examples/sqlx_sqlite)`
versions that meet the requirements `^0` are: 0.6.0, 0.5.0, 0.4.0, 0.3.1, 0.3.0, 0.2.2, 0.2.1, 0.2.0, 0.1.0

the package `sea-query-binder` links to the native library `sqlite3`, but it conflicts with a previous package which links to `sqlite3` as well:
package `sqlx v0.8.0`
    ... which satisfies dependency `sqlx = "^0.8"` of package `sea-query-sqlx-sqlite-example v0.1.0 (/Users/mattrighetti/Developer/sea-query/examples/sqlx_sqlite)`
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.

the package `sea-query-sqlx-sqlite-example` depends on `sea-query-binder`, with features: `runtime-async-std-native-tls` but `sea-query-binder` does not have these features.

failed to select a version for `sea-query-binder` which could resolve this conflict

I've tried on a different arch as well but the issue persists.

mattrighetti commented 1 month ago

https://github.com/SeaQL/sea-query/issues/669#issue-1835776511 seems related