Cargo optional feature (those with ?) is not working as expected #14494
Labels
A-dependency-resolution
Area: dependency resolution and the resolver
A-features
Area: features — conditional compilation
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
I'm using
sqlx
library which has a big usage of optional feature dependencies (I'm not sure if the name is correct, it's in a form likesqlx-sqlite?/chrono
).It works perfectly with exlucding optional features. However, when building the dependency graph, I found it's still including those optional one, which can cause conflict for libraries you don't really use.
Steps
Create a project with these dependencies and run
cargo tree
cargo tree
result looks great and no sqlite dependencies are included. However, if I have a sqlite dependency in the project, it cause conflictsNow cargo refuses to build the dependency graph
However, we don't really included
sqlx-sqlite
in our project. So I consider this a bug for optional feature implementation.Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: