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

cargo tree: feature request: print features used to build each crate in tree #10949

Closed
fschutt opened this issue Aug 8, 2022 · 2 comments
Closed
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@fschutt
Copy link
Contributor

fschutt commented Aug 8, 2022

Problem

This is a re-open of sfackler/cargo-tree#18 - the issue seems to have gotten dropped silently when the repository was merged into rust-lang/cargo. Often times, when debugging why certain dependencies are pulled in, it is important to know which features are enabled on the crates dependencies (in order to debug what features depend on each other). Dealing with feature flags that depend on each other is currently a mess in larger projects.

Proposed Solution

An example of what I'd like to see is something like this (printing the enabled as well as the available features):

$ cargo tree --print-features
wasmer-cli v3.0.0-alpha.4 ["http", "wasi", "wat"] # inactive: ["cache", "emscripten", "compiler"]
├── http_req v0.8.1 ["rustls", "webpki", "webpki-roots"] # inactive: ["native-tls"] 
│   ├── rustls v0.19.1 [...]

Notes

No response

@fschutt fschutt added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Aug 8, 2022
@ehuss
Copy link
Contributor

ehuss commented Aug 8, 2022

This is available with the format flag: cargo tree -f "{p} {f}"

The cargo tree docs include some examples of how to explore features.

@fschutt
Copy link
Contributor Author

fschutt commented Aug 8, 2022

Alright, then this issue can be closed, thank you.

@fschutt fschutt closed this as completed Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants