Open LecrisUT opened 1 week ago
Why do you want sqlx-sqlite
in fedora in the first place?
It is not like that lib can be linked against.
For anything rust related, using the regular crate is likely a better fit, or am I missing something?
sqlx = { version = "0.7", features = [ "runtime-tokio", "sqlite"] }
Fedora packaging policy is to package each crate individually. The main project that I'm trying to package is atuin
which depends on both sqlx
and sqlx-sqlite
.
People tend to disagree with this non-vendored approach, but this has benefits for distro packagers particularly in the control of security patches.
From https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/
Rust projects that are organized as cargo "workspaces"
For [this case], the rust2rpm tool can be used to generate spec files from cargo / crate metadata. It is designed to produce spec files that are in line with the (Rust) Packaging Guidelines
=> I (not a maintainer) would consider that package as an "internal implementation detail" and choose the cargo workspace projects rules for fedora packaging.
atuin
which depends on bothsqlx
andsqlx-sqlite
I only see the following. Am I missing something? https://github.com/atuinsh/atuin/blob/f56a66add9e64151e98ce35c3e85f436927c1ac3/Cargo.toml#L55
Workspace projects are only used when there is no other package that depends on it. That is because the crates cannot be extracted in the current workflow and sometimes projects do not have version sync on the workspace. Unfortunately sqlx
is used as a crate so it needs to be broken down.
For atuin see this section. The direct dependency is sqlx[sqlite]
, but in order to package that, sqlx-sqlite
is needed among the other dependencies.
When running the tests for
sqlx-sqlite
in Fedora packaging I get the following error:This issue is not detected when running from workspace because
sqlx-core
includes theclock
featureand
sqlx-sqlitedepends on
sqlx-core. But when building and testing the
sqlx-sqlite` crate standalone with all features enable, this issue pops up.How about either adding the clock feature to the base workspace dependency or adding those features to each crate? Probably there are some other dependencies with similar issues.