jplatte / cargo-depgraph

Creates graphviz dependency graphs for Rust projects that use Cargo
GNU General Public License v3.0
159 stars 9 forks source link

Exclude flag still uses excluded packages to resolve features #8

Open jplatte opened 3 years ago

jplatte commented 3 years ago

Imported from sourcehut todos, originally reported by @vberger.

Tested on Smithay master (commit 25365ed69abbff56a9b188a37b9cd2469e2bc642).

Comparing:

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 of smithay's feature to be enabled even though the --no-default-features flag was passed.

jplatte commented 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.