Resolver does not lock disabled nested optional dependencies. #7792
Labels
A-dependency-resolution
Area: dependency resolution and the resolver
A-optional-dependencies
Area: dependencies with optional=true
C-bug
Category: bug
If you have a dependency with an optional dependency that is not enabled by default, then that dependency will not get recorded in
Cargo.lock
. However, it is possible to build it with the--features
flag. I can't tell if this is intentional or not.Example: a → b →(optional) c
In
a
, runcargo build --features b/c
@Eh2406 Do you happen to know if this is intentional? If not, how feasible would it be to change?
For resolving features independently, I was hoping I could build the resolve graph with
--all-features
, but that doesn't work for cases like this (c
will be missing from the result).As a follow-up question, how crazy would it be to resolve the entire graph assuming all optional dependencies are enabled? I assume that could cause problems since that could add more constraints to existing projects that might create conflicts.
NOTE: #2851 (comment) seems kinda relevant. Support was added in #2876.
The text was updated successfully, but these errors were encountered: