You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is hard to know why a specific crate is required (and why it has a specific version).
Proposed Solution
There could be a sub command named why that could display the constraints applied to a crate and the dependency tree linked to it in order to understand why a specific crate is required.
The tree command also supports showing enabled features for dependencies. But unfortunately, it doesn't cover "why it has a specific version" as you mentioned.
Since we have cargo tree -i, do we still need this issue? Is there something we could do to make it easier to go from user problem ("why this dependency") to discovering cargo tree -i?
Granted, for myself, I just use cargo tree | less and just search the output because I forget about -i (speaking of, maybe we should have pager support for cargo tree).
Activity
[-]`cargo why <crate>` package[/-][+]`cargo why <crate>`[/+]weihanglo commentedon Nov 10, 2021
cargo-treecovers some usages here. For example. runcargo tree -i curlshows the reversed dependency tree:The tree command also supports showing enabled features for dependencies. But unfortunately, it doesn't cover "why it has a specific version" as you mentioned.
homersimpsons commentedon Nov 11, 2021
Oh, I didn't notice that you could invert
cargo-tree. Thank you for this information !epage commentedon Apr 20, 2022
Since we have
cargo tree -i, do we still need this issue? Is there something we could do to make it easier to go from user problem ("why this dependency") to discoveringcargo tree -i?Granted, for myself, I just use
cargo tree | lessand just search the output because I forget about-i(speaking of, maybe we should have pager support forcargo tree).epage commentedon Oct 31, 2023
Closing this as covered by
cargo tree. #12903 adds some more documentation around this.