Open RagnarGrootKoerkamp opened 1 year ago
I think it makes sense for this to be the default behavior of --dedup-transitive-deps
, not just for optional dependencies, but target-specific dependencies as well.
Yes I agree. Then the question becomes how to handle optional and target-specific dependencies when there is a path of optional/target-specific dependencies (as opposed to a path of required dependencies where the situation is simple).
I think optional deps should still be shown, but target-specific deps can be inferred through each other.
One issue with this could be when a long chain of packages has a similar feature flag to enable one specific dependency (say clap
), and then we draw multiple optional lines to that package. On the other hand, drawing the dependency only for the bottom one isn't complete either.
Locally I wrote some code to generate the image below. This deduplicates transitive dependencies, but keeps those that 'go around' optional deps. I.e., the solid line between
pa-web
andpa-vis
is nice because without it (the current behavior) it would seems as though a large part of the tree is optional, while in fact it's not.Would you accept a PR for it? And in that case, what should the flag be named? I'm not sure myself. And should this be default?