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

[KNOWN ISSUE] Unexpected/unwanted crates in Cargo.lock #3211

Open
abonander opened this issue Apr 21, 2024 · 0 comments
Open

[KNOWN ISSUE] Unexpected/unwanted crates in Cargo.lock #3211

abonander opened this issue Apr 21, 2024 · 0 comments
Labels
bug:rust Indicates a bug or regression in Rust bug

Comments

@abonander
Copy link
Collaborator

abonander commented Apr 21, 2024

This issue is to serve as an aggregation point for issues like the following:

All of these issues have the same root cause: enabling a feature of SQLx that enables a weak feature, i.e. crate?/feature.

This will bring that feature's crate into the Cargo.lock which may make it appear that it is enabling code or dependencies that were explicitly not wanted (unused database drivers, dependencies with RUSTSEC advisories, etc.). In the case of #2964, it unfortunately appears that this can break dependency resolution since crates with native dependencies like libsqlite3-sys cannot be duplicated in the dependency graph.

This is a Cargo bug, not a SQLx bug.

We are using weak features for their intended purpose. The issue has been known upstream since 2022: rust-lang/cargo#10801

Don't comment here or on rust-lang/cargo#10801 unless you have something meaningful to add.

Complaining on the Cargo issue will just add noise and bury any productive discourse.

Read the discussion there and the proposed fix and its blockers to inform yourself of the situation before commenting.

Maybe you can be the one to fix it?

Just because it appears in the Cargo.lock does not mean it's getting compiled.

You can verify this yourself when performing a clean build of your project.

Interpret the output of any tool that just reads your Cargo.lock with a few grains of salt, and maybe help make sure that the authors of those tools are aware of this issue so they can take it into account.

Thank you.

@abonander abonander added bug bug:rust Indicates a bug or regression in Rust labels Apr 21, 2024
@abonander abonander pinned this issue Apr 21, 2024
abonander added a commit that referenced this issue Apr 21, 2024
koeninger-ironlight added a commit to Ironlight-Group/sqlx that referenced this issue Apr 23, 2024
QAston pushed a commit to ChorusOne/sqlx that referenced this issue Apr 26, 2024
QAston pushed a commit to ChorusOne/sqlx that referenced this issue Apr 26, 2024
theo-zil added a commit to Zilliqa/zq-base that referenced this issue May 8, 2024
Due to a cargo bug, this was causing issues with adding rusqlite to ZQ2. See launchbadge/sqlx#3211 - Cargo would detect a spurious version conflict in the sqlite version to bundle.
However sqlx appears completely unused in zqutils so removing the dependency entirely is an easy fix.
rrw-zilliqa pushed a commit to Zilliqa/zq-base that referenced this issue May 13, 2024
Due to a cargo bug, this was causing issues with adding rusqlite to ZQ2. See launchbadge/sqlx#3211 - Cargo would detect a spurious version conflict in the sqlite version to bundle.
However sqlx appears completely unused in zqutils so removing the dependency entirely is an easy fix.
jayy-lmao pushed a commit to jayy-lmao/sqlx that referenced this issue Jun 6, 2024
@abonander abonander changed the title [KNOWN ISSUE] Enabling some optional features adds unexpected crates to Cargo.lock [KNOWN ISSUE] Unexpected/unwanted crates in Cargo.lock Jul 28, 2024
koeninger added a commit to koeninger/sqlx that referenced this issue Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:rust Indicates a bug or regression in Rust bug
Projects
None yet
Development

No branches or pull requests

1 participant