Description
As of rust-lang/cargo#4953, Cargo supports renaming dependencies from Cargo.toml. For example the following dependency specification would introduce a dependency on a crate whose real name is tarpc-lib
, but referring to it as rpc
within the current crate.
[dependencies]
rpc = { package = "tarpc-lib", version = "0.1" }
This introduces the potential for feature names that cannot be meaningfully interpreted through the API of crates.io. Consider tarpc 0.13.0:
$ curl https://crates.io/api/v1/crates/tarpc/0.13.0
{
"version": {
"id": 113315,
"crate": "tarpc",
"num": "0.13.0",
...
"features": {
"serde1": [
"rpc/serde1",
"serde",
"serde/derive"
]
},
...
}
}
$ curl https://crates.io/api/v1/crates/tarpc/0.13.0/dependencies
{
"dependencies": [
...
{
"id": 529683,
"version_id": 113315,
"crate_id": "tarpc-lib",
"req": "^0.1",
"optional": false,
"default_features": true,
"features": [],
"target": null,
"kind": "normal",
"downloads": 0
},
...
]
}
There is no indication that the "rpc/serde1"
feature depended on by tarpc
's "serde1"
feature refers to the dependency on tarpc-lib
. This information lives only in Cargo.toml.
I would like to see renames listed in the response of /crates/:crate_id/:version/dependencies so that the complete dependency graph can be understood without downloading the crate's source.