-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Format change of ids in 'cargo metadata' with cargo 1.78 #13528
Comments
This is not considered a breaking change. From https://doc.rust-lang.org/1.76.0/cargo/commands/cargo-metadata.html#output-format
With the change that was made, we have stabilized the format and you can rely on it, see #12914 |
If you want to get the name and version of a package that‘s referenced as a resolved dependency or as a workspace member, you seem to have to parse the id. Therefore I‘m not quite sure that I would consider this as a non breaking change.
|
For this use case, it doesn't seem to. |
On Mon, Mar 04, 2024 at 10:54:21AM -0800, Weihang Lo wrote:
For this use case, it doesn't seem to. `workspace_members` array
contains IDs that you can find matching `id` of a package in
`packages` array.
Yes, you're right.
From my point of view this ticket can then be closed.
|
While it's true for workspace members, is there currently any reliable way to get the name corresponding to an indirect dependency by the package ID specifier without having to parse it? Because it seems like there's currently no way to reliably resolve a Edit: Of course, it doesn't seem to be possible to do this reliably on 1.77 even if we parse the ID since the So it seems to me that unless #7289 is implemented there's still no way to do this without making assumptions on the ID format that cargo will emit. |
@kyrias can't iterate over |
@epage |
Wait, that's not true, it seems to contain some but not all indirect dependencies? I'm confused now. |
Ah, I guess the issue here is that we're using It's a bit unfortunate since it means that you can't use the |
Problem
The format of the id entries in the cargo metadata changes in cargo 1.78.
In cargo 1.76 the format is:
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)"
In cargo 1.78 the format is:
"registry+https://github.com/rust-lang/crates.io-index#ansi_term@0.11.0"
Both formats are with '--format-version 1'. Is this considered as a breaking change?
Steps
Possible Solution(s)
No response
Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered: