~boringcactus/cargo-why#1: 
[Feature Request] Searching for specific version of dependency

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

Status
REPORTED
Submitter
github:dima74
Assigned to
No-one
Submitted
4 years ago
Updated
4 years ago
Labels
No labels applied.

github:boringcactus 4 years ago ยท edit

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.

Register here or Log in to comment, or comment via email.