Include registry names in cargo metadata output #9052
Labels
A-registries
Area: registries
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-metadata
Describe the problem you are trying to solve
For some automated tooling built on top of guppy, I'd like to be able to reconstruct
Cargo.toml
dependency lines fromcargo metadata
output. This is possible to do forcrates.io
, path and Git dependencies, but doesn't appear to be possible to do for non-default registries.Specifically, the bit that's missing is the name of the registry. The output format has a
"registry"
field in the dependencies section, but that contains the URL and not the name. The URL cannot be specified inCargo.toml
's registry field -- it must be a name.Describe the solution you'd like
There's a few ways to do this, but I think the cleanest way would be to add a new top-level section to
cargo metadata
output, sayregistries
, which has:The text was updated successfully, but these errors were encountered: