Add a way to refer to a particular target in JSON messages #5508
Labels
A-json-output
Area: JSON message output
Command-metadata
S-needs-design
Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Package
andTarget
are two important internal datastructures in Cargo, and we expose them for tools via various JSON messages.To refer to a pacakge, we use an opaque in theory
PackageId
string. We don't have an obvious way to refer to a target of a package, and that I think causes problems.Specifically, I think we have three places which would like to refer to targets, and each does it in its own way:
Artifact
, we refer to target by just printing the whole targetTargetKind
, which is ambiguous.Possible solution
Just use the whole target as in
Artifact
, everywhere (on the one hand, this seems kind-of inelegant and duplicate, on the other hand, this is simple and straightforward)Use path to root file as a target_id, or (if that's ambigious), a pair of
kind, path
The text was updated successfully, but these errors were encountered: