cargo-why icon indicating copy to clipboard operation
cargo-why copied to clipboard

[Feature Request] Searching for specific version of dependency

Open dima74 opened this issue 5 years ago • 1 comments

For example when crate has dependencies on both winapi 0.2 and winapi 0.3, you may want to determine why you have winapi 0.2

dima74 avatar Sep 02 '20 08:09 dima74

Surprisingly, that's already possible, as long as you know the full version of the crate:

PS D:\Melody\Projects\old projects\cargo-why> cargo why "libc 0.2.66"
cargo-why -> failure -> backtrace -> backtrace-sys -> libc 0.2.66
cargo-why -> failure -> backtrace -> libc 0.2.66

This works because the package ID is "<name> <version> (<source>)" (e.g. libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)) and so the test here still works

https://github.com/boringcactus/cargo-why/blob/9929b2077bcf832bb046261337b21e234167a21f/src/main.rs#L70

I'll think about giving this more robust support at some point, but as it stands it's technically possible already.

boringcactus avatar Sep 03 '20 05:09 boringcactus