-
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
Checksum of yanked version causing crate download to fail #11412
Comments
So ndk-sys has
Everything after
Interesting, semver doesn't say the two versions are the same. I do find it surprising that crates.io allows you to upload two of the same "version" and I suspect this is what is confusing cargo. |
This is a known issue with crates.io (rust-lang/crates.io#1059). It should not be allowing publishes with versions that only differ in metadata. Fixing that is a little tricky, unfortunately. |
There is some code in |
For completeness I described the same issue and posted the publishing+yanking steps for |
If I'm not mistaken the origin of this issue is now fixed, no longer allowing one to publish the same version with only metadata differences: rust-lang/crates.io#6518 However, this issue might linger for some time (e.g. if explicitly referencing the duplicate-but-yanked |
Problem
The package
ndk-sys
has a latest version0.4.0
and a more recent yanked version0.4.0+25.0.8775105
. Cargo is downloading the 0.4.0 crate, but comparing the hash with the checksum of the yanked version, and therefore failing with a "failed to verify checksum of ndk-sys v0.4.0" error.It seems to be a sporadic issue - sometimes the download will complete successfully, sometimes it will fail due to the checksum not matching.
This happens even though the lockfile has the correct version and checksum for v0.4.0.
Checksum of 0.4.0:
21d83ec9c63ec5bf950200a8e508bdad6659972187b625469f58ef8c08e29046
Checksum of 0.4.0+25.0.8775105:
f74ddd54b7da8d38d399faf43472ac9759f1a028a45c83154bff603e0f56385a
Steps
cargo init
.21d83ec9c63ec5bf950200a8e508bdad6659972187b625469f58ef8c08e29046
You might need to repeat steps 3 and 4 a few times.
Possible Solution(s)
No response
Notes
As far as I can tell it's not a crates.io issue. The download can fail multiple times then sporadically start working without a crates.io index update, and with identical
.crate
files being downloaded (checked with a proxy).I added some logging to Cargo which was how I validated it was using the checksum of the yanked version:
Version
The text was updated successfully, but these errors were encountered: