-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #7132 - ehuss:metadata-kind, r=alexcrichton
Add kind/platform info to `cargo metadata` This adds an array `"dep_kinds"` to the resolve nodes of the `cargo metadata` output. It looks something like this: ```javascript "resolve": { "nodes": [ "id": "cargo 0.39.0 (path+file:///Users/eric/Proj/rust/cargo2)", "deps": [ { "name": "bufstream", "pkg": "bufstream 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "dep_kinds": [ { "kind": "dev", "target": null } ] }, { "name": "winapi", "pkg": "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "dep_kinds": [ { "kind": null, "target": "cfg(windows)" } ] } ] ] } ``` This allows one to filter the graph based on the dependency kind and platform. I'm not completely confident that this is the right course, but I can't think of a better design. In particular, it seems a little strange to include all platforms, but features get filtered. This is probably not a problem in practice (one can use `--all-features` to ensure all features are shown for the top-level packages). Filtering out based on platform is very difficult, because you cannot determine from the resolve alone which nodes will be host vs target. That requires the entire Unit graph. We may expose the Unit graph in the future, but this seems like a useful and simple step. This is a draft because I wanted to discuss this before moving forward. I'd like to add some more tests. cc #4632. This doesn't filter based on target, but does expose the target names. As mentioned above, I don't think filtering is possible. cc #5583. This adds more information. Closes #3984. Closes #4631 (I think). cc @sfackler who filed some of these issues.
- Loading branch information
Showing
6 changed files
with
311 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.