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

chrono.clock feature is not enabled on all crates #3332

Closed
LecrisUT opened this issue Jul 5, 2024 · 4 comments · Fixed by #3365
Closed

chrono.clock feature is not enabled on all crates #3332

LecrisUT opened this issue Jul 5, 2024 · 4 comments · Fixed by #3365
Labels

Comments

@LecrisUT
Copy link
Contributor

LecrisUT commented Jul 5, 2024

When running the tests for sqlx-sqlite in Fedora packaging I get the following error:

`chrono::Local` is gated behind `clock` feature

This issue is not detected when running from workspace because sqlx-core includes the clock featureandsqlx-sqlitedepends onsqlx-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.

@LecrisUT LecrisUT added the bug label Jul 5, 2024
@CommanderStorm
Copy link
Contributor

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"] }

@LecrisUT
Copy link
Contributor Author

LecrisUT commented Jul 7, 2024

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.

@CommanderStorm
Copy link
Contributor

CommanderStorm commented Jul 7, 2024

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 both sqlx and sqlx-sqlite

I only see the following. Am I missing something?
https://github.com/atuinsh/atuin/blob/f56a66add9e64151e98ce35c3e85f436927c1ac3/Cargo.toml#L55

@LecrisUT
Copy link
Contributor Author

LecrisUT commented Jul 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants