feat(tree): show artifact dependency details#17075
Conversation
|
r? @ehuss rustbot has assigned @ehuss. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| } | ||
| } | ||
|
|
||
| #[derive(Debug, Copy, Hash, Eq, Clone, PartialEq)] |
There was a problem hiding this comment.
tip: splitting changes like this into their own commit make it easier / faster for maintainers to review, see https://epage.github.io/dev/pr-style/#c-atomic
| .with_status(0) | ||
| .run(); | ||
|
|
||
| p.cargo("tree -Z bindeps -e features") |
There was a problem hiding this comment.
We ask for new test cases to be added in their own commit first, with tests passing in that commit, see https://epage.github.io/dev/pr-style/#c-test
| ws: &Workspace<'_>, | ||
| graph: &'a Graph<'_>, | ||
| node_index: NodeId, | ||
| incoming_edge: Option<&Edge>, |
There was a problem hiding this comment.
If we are relying on the incoming edge. Are there times where we have different edges but the same node? For example, what happens if a package has a regular dep and an artifact dep on a package?
#16192 also deals with edges and may have other relevant concerns.
| r#"... | ||
| foo v0.1.0 ([ROOT]/foo) | ||
| └── bar v0.1.0 ([ROOT]/foo/bar) | ||
| └── bar v0.1.0 ([ROOT]/foo/bar) (artifact: bin, target=[ALT_TARGET]) |
There was a problem hiding this comment.
This PR is marked as closing the issue but part of the issue is how to visually represent the graph.
Add cargo tree coverage for artifact dependencies before changing their visual output. The baseline keeps the current behavior: artifact dependencies are displayed in their dependency section without artifact-specific annotation.
Carry artifact dependency metadata on cargo tree edges and annotate artifact edges with the requested artifact kinds, lib flag, and target when present. This keeps the metadata tied to the incoming edge, so a package reached by both a normal dependency and an artifact dependency only shows the artifact annotation on the artifact edge. Refs rust-lang#14804.
2eb63a0 to
83d0988
Compare
|
I traced the design history through #10593, #14804, #14658, RFC 3028, The concrete proposal in #10593 / #14804 was to annotate artifact This PR takes that minimal textual approach, but spells the annotation I did not implement dashed-line rendering in this PR. Line style could If dashed-line rendering would be valuable, I am happy to implement that I also changed this from |
Carry artifact dependency metadata on
cargo treeedges and annotate artifact edges with the requested artifact kinds,libflag, and target when present.This makes artifact dependencies visible without changing dependency resolution or node identity. Feature-edge output keeps the annotation on the package node so
cargo tree -e featuresstill exposes the artifact request.Closes #14804.