Open jplatte opened 3 years ago
This is a consequence of how cargo resolves features. I suspect not even the new feature resolver will work in the workspace scenario. If somebody finds a way of making cargo metadata
not include the optional dependencies in this case, it should be easy to put in the necessary plumbing in cargo-depgraph to expose that.
Imported from sourcehut todos, originally reported by @vberger.
Tested on Smithay master (commit 25365ed69abbff56a9b188a37b9cd2469e2bc642).
Comparing:
cargo depgraph --all-deps --exclude anvil --no-default-features
on the bare repo[workspace]
section in theCargo.toml
to make as if anvil did not exist, deletingCargo.lock
, and runningcargo depgraph --all-deps --no-default-features
This first graph is very large and includes almost all dependencies, while the second is very small (as expected).
I suspect that even when
anvil
is excluded, it is still being used to resolved features, causing most ofsmithay
's feature to be enabled even though the--no-default-features
flag was passed.