Open jwodder opened 1 year ago
Agreed, this would be nice to have. I'm not sure how to implement this off the top of my head as this tool heavily relies on cargo-metadata to build up the deps, and I'm not sure that is target aware.
cargo metadata
has a --filter-platform <triple>
option for only showing dependencies for a given triple, so one way to implement this would be run the command for each triple and combine the results.
That does seem like it should work...
I don't have a lot of spare time at the moment but I do want to work this in at a future point!
If one is planning to only build & distribute binaries of a project for a limited number of targets, it doesn't make much sense to bundle licenses for dependencies exclusive to other targets that will never be used. (For example, if a project depends on
chrono
and itsclock
feature, theniana-time-zone
will be pulled into the dependency tree, and this package depends onandroid_system_properties
on Android andjs-sys
&wasm-bindgen
on WASM, but if you're only building for Linux, macOS, and Windows, you shouldn't need to bundle those packages' licenses.)I therefore request a feature for specifying a set of target triples by which to filter the dependencies for which licenses are bundled.