Skip to content
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

Crate hash loading from Cargo.lock is broken in Rust 1.77 #340

Closed
pacak opened this issue Mar 25, 2024 · 0 comments · Fixed by #341
Closed

Crate hash loading from Cargo.lock is broken in Rust 1.77 #340

pacak opened this issue Mar 25, 2024 · 0 comments · Fixed by #341

Comments

@pacak
Copy link
Contributor

pacak commented Mar 25, 2024

rust-lang/cargo#12914 changed how package ID looks like, now it's something like this:

-"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)"
+"https://github.com/rust-lang/crates.io-index#bitflags@1.0.4"

This changed how PackageId is represented:
https://docs.rs/cargo_metadata/latest/cargo_metadata/struct.PackageId.html

It is possible to inspect the repr field, if the need arises, but its precise format is an implementation detail and is subject to change.

At the same time lock.rs creates them from parts:

repr: format!("{} {} ({})", name, version, source),

As a result mapping between "shortened" and "full" ids breaks, and it fails to find any hashes. It's not the end of the world - crate2nix can fetch crates on it's own and place them in a file, but this is very slow if you have a lot of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant