-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
A-json-outputArea: JSON message outputArea: JSON message outputC-tracking-issueCategory: A tracking issue for something unstable.Category: A tracking issue for something unstable.S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.S-waiting-on-feedbackStatus: An implemented feature is waiting on community feedback for bugs or design concerns.Status: An implemented feature is waiting on community feedback for bugs or design concerns.
Description
Implementation: #7977
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#unit-graph
Summary
The --unit-graph
flag emits a JSON structure showing Cargo's internal unit graph.
Unresolved issues
- Is there a better way to expose this information? I think in many cases, to make this useful, you have to also run
cargo metadata
(to get package names, for example). It seems a little silly to have to run two commands. Adding this tocargo metadata
I think will be hard from a UX standpoint. It would require a superset of all flags of all commands (for example,cargo check --profile=test
fundamentally changes things, so it would need to reproduce that flag). Every time I look at that, it seems really messy. There's also some flags like--target
that don't interact withcargo metadata
very well.- The primary motivator is to get access to feature relationships. But maybe there is a better way to deal with that?
- Which parts of the output should be stabilized? This structure is very low-level, and thus inherently at high risk of changing in the future and being unstable. I think at a minimum we should document that it is not guaranteed to be backwards compatible. Should we filter some fields on stable?
- Can't differentiate a normal
check
and acheck
for a test. The serialize implementation forCompileMode
does not output the different kinds. Not sure how this should be displayed.
matklad, Byron, weihanglo, sheeeng and boozook
Metadata
Metadata
Assignees
Labels
A-json-outputArea: JSON message outputArea: JSON message outputC-tracking-issueCategory: A tracking issue for something unstable.Category: A tracking issue for something unstable.S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.S-waiting-on-feedbackStatus: An implemented feature is waiting on community feedback for bugs or design concerns.Status: An implemented feature is waiting on community feedback for bugs or design concerns.
Type
Projects
Status
Unstable, baking