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

Exclude flag still uses excluded packages to resolve features #8

Open
jplatte opened this issue Jan 27, 2021 · 1 comment
Open

Exclude flag still uses excluded packages to resolve features #8

jplatte opened this issue Jan 27, 2021 · 1 comment

Comments

@jplatte
Copy link
Owner

jplatte commented Jan 27, 2021

Imported from sourcehut todos, originally reported by @vberger.

Tested on Smithay master (commit 25365ed69abbff56a9b188a37b9cd2469e2bc642).

Comparing:

  • running cargo depgraph --all-deps --exclude anvil --no-default-features on the bare repo
  • removing the [workspace] section in the Cargo.toml to make as if anvil did not exist, deleting Cargo.lock, and running cargo 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 of smithay's feature to be enabled even though the --no-default-features flag was passed.

@jplatte
Copy link
Owner Author

jplatte commented Jan 27, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant