forked from rust-lang/cargo
-
Notifications
You must be signed in to change notification settings - Fork 2
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 rust-lang#5461 - matklad:meta-rename, r=alexcrichton
Support crate renames in `cargo metadata` This adds information about (currently unstable) crate renames to metadata. Unfortunately, we already expose dependencies as a list of package ids (which are strings), so we can't easily add a `rename` field easily. For this reason, I've added a parallel `deps` key, which basically deprecates `dependencies` field. So, the new format looks like this ```JavaScript { "dependencies": [ "bar 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bar 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" ], "deps": [ { "extern_crate_name": "baz", // this one is actually renamed "id": "bar 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" }, { "extern_crate_name": "bar", "id": "bar 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" } ], "features": [], "id": "foo 0.5.0 (path+file://[..])" }, ``` Questions: * Is there a better name for `extern_crate_name`? This name is precise, but it's longer than I like, and might become opaque in meaning if we remove `extern crate` from the language :) * Should we feature gate this (i.e, only produce `deps` if we have a feature in `Cargo.toml`)? I think the answer is yes, but that'll require threading `Features` to `Workspace`... r? @alexcrichton
- Loading branch information
Showing
5 changed files
with
316 additions
and
39 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.