Closed
Description
Maybe not a bug.
Problem
Crates with semver build metadata (e.g. 1.1.1+2
) seem to have issues with:
error: checksum for `runng-sys v1.1.1+4` changed between lock files
Or:
error: failed to verify the checksum of `runng-sys v1.1.1`
Details:
- I wanted a crate of FFI bindings to track the version of the native library (e.g.
1.1.1
) - Tried to use semver build metadata for "minor" crate updates that still used the same version of the native library (e.g.
1.1.1+2
) - First ran into problems getting doc.rs to pull and build the correct version (failed builds), eventually getting it to work by yanking all but the most recent crate (crates.io version history)
- If all versions except 1.1.1+4 are yanked, Cargo.toml with
runng-sys = "1.1.1"
fails witherror: checksum for XYZ changed between lock files
- If all versions except 1.1.1 and 1.1.1+4 are yanked, Cargo.toml with
runng-sys = "1.1.1"
fails witherror: failed to verify the checksum
- Everything is fine when using path dependencies:
runng-sys = { path = XYZ }
I've flailed around with this enough that I'm not entirely sure what the problem is. Rather than publishing more packages and digging myself a deeper hole, thought I should stop and ask.
Also see:
Steps
Made a dummy package cargo_issue_6504 to verify it has nothing to do with my stuff.
Both 1.1.1 and 1.1.1+1 are not yanked:
cargo new test2
- In Cargo.toml,
cargo_issue_6504 = "1.1.1"
cargo build
fails withfailed to verify the checksum
2.2.2 is yanked, 2.2.2+1 is not:
cargo new test2
- In Cargo.toml,
cargo_issue_6504 = "2.2.2"
cargo build
succeeds- Second
cargo build
fails withchecksum for XXX changed between lock files
Possible Solution(s)
- Seems to be several dangling issues related to semver
+
metadata (1, 2, several others) - Supporting build metadata adds flexibility (especially with publishing to crates.io being permanent), but...
- Maybe there should at least be a warning that "your package isn't going to work"
Notes
Output of cargo version
:
cargo 1.31.0 (339d9f9c8 2018-11-16)