From: bors Date: Sat, 5 May 2018 21:32:18 +0000 (+0000) Subject: Auto merge of #5461 - matklad:meta-rename, r=alexcrichton X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d0d3cb5ac963eb8c3f83d079b6a547992cac2cc4;p=cargo.git Auto merge of #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 --- d0d3cb5ac963eb8c3f83d079b6a547992cac2cc4