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

Factor out common duplicate paths

Open djc opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

When trying to understand where duplicate dependencies are coming from, the trees displayed by default by cargo deny check are quite helpful. However, in some common cases I think they could be easier to navigate. For example, consider the windows target crates, which are a common source of duplicate dependencies for me:

  • windows-sys 0.48 and windows-sys 0.52 each get pulled into the dependency graph
  • Each of these depend on respective windows-targets versions (0.48.x and 0.52.x)
  • The windows-targets crate then pulls in all of the following:
    • windows_aarch64_gnullvm
    • windows_aarch64_msvc
    • windows_i686_gnu
    • windows_i686_msvc
    • windows_x86_64_gnu
    • windows_x86_64_gnullvm
    • windows_x86_64_msvc

The current output from cargo deny takes... a lot of scrolling to explain this:

https://dpaste.org/rsOoi

(Too long to paste into a GitHub comment.)

Describe the solution you'd like

Would be great to eliminate common subgraphs when explaining duplicate dependencies.

djc avatar Mar 05 '24 11:03 djc

This isn't a solution, of course, but you can use --hide-inclusion-graph to make the output for duplicate crates more readable.

Lynnesbian avatar Oct 17 '25 13:10 Lynnesbian

Ah, and I've just found a better solution: You can add windows-sys to the skip-tree section.

I think this actually resolves your issue!

Lynnesbian avatar Oct 17 '25 13:10 Lynnesbian