-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose dependency renames so that enabled features make sense #1539
Comments
We obtain this data from cargo in JSON format when the crate is published. This data is also passed to the index, so there are constraints on possible changes. Here is how this looks in the index: {
"name":"tarpc",
"vers":"0.13.0",
"deps":[
{
"name":"log",
"req":"^0.4",
"features":[
],
"optional":false,
"default_features":true,
"target":null,
"kind":"normal"
},
{
"name":"rpc",
"req":"^0.1",
"features":[
],
"optional":false,
"default_features":true,
"target":null,
"kind":"normal",
"package":"tarpc-lib"
},
...
],
"cksum":"bbeb0a79553718585c855186a77d257deed78d5f06c47d7f840d6a1c46864bac",
"features":{
"serde1":[
"rpc/serde1",
"serde",
"serde/derive"
]
},
"yanked":false,
"links":null
} So cargo and the index track the My preferred solution would be for cargo to send us two feature lists. The existing one is for when cargo is talking to itself via the index. If the new key is also provided, then this is recorded in the database; otherwise we fallback to the existing key. This does have the disadvantage that it will take time to reach stable and older clients will continue to publish sub-optimal metadata, but I think that would be better than coupling to the index format and rewriting the features list on this end. |
Is there anything blocking this right now? |
Fixed by #5091, I believe. |
not entirely yet. we still need to expose the data on the API level and backfill the database, but it should be done soon :) |
Oh good call, I forgot this issue is about the JSON API and not the DB dumps, since I'd switched my use case over to use DB dumps a long time ago. Reopening. |
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 asrpc
within the current crate.This introduces the potential for feature names that cannot be meaningfully interpreted through the API of crates.io. Consider tarpc 0.13.0:
There is no indication that the
"rpc/serde1"
feature depended on bytarpc
's"serde1"
feature refers to the dependency ontarpc-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.
The text was updated successfully, but these errors were encountered: