vlvicente opened a new issue, #103:
URL: https://github.com/apache/casbin-rust-diesel-adapter/issues/103
`libsqlite3-sys` is a hard dependency, so postgres/mysql builds still
compile and link a bundled SQLite. It is declared in `[dependencies]` rather
than behind the crate's own `sqlite` feature:
```toml
# Cargo.toml
libsqlite3-sys = { version = "0.26.0", features = ["bundled"] }
[features]
default = ["postgres", "runtime-tokio"]
sqlite = ["diesel/sqlite", "libsqlite3-sys/bundled"]
```
Because it is not optional, `diesel-adapter = { version = "1.2.0", features
= ["postgres"] }` still pulls it in. With `bundled` enabled, SQLite is compiled
from source and statically linked into the consumer's binary — for a
Postgres-only adapter.
Nothing in the crate refers to `libsqlite3_sys` in code. The only sqlite
usage is behind `#[cfg(feature = "sqlite")]` in `src/adapter.rs:464` and
`src/actions.rs:21,73`, and it goes through `diesel`.
## Proposed fix
```diff
-libsqlite3-sys = { version = "0.26.0", features = ["bundled"] }
+libsqlite3-sys = { version = "0.26.0", features = ["bundled"], optional =
true }
-sqlite = ["diesel/sqlite", "libsqlite3-sys/bundled"]
+sqlite = ["diesel/sqlite", "dep:libsqlite3-sys", "libsqlite3-sys/bundled"]
```
Happy to open a PR — the branch is ready.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]