jeikabu / runng

MIT License
25 stars 3 forks source link

Checksum change on second build #11

Closed sphinxc0re closed 5 years ago

sphinxc0re commented 5 years ago

I'm evaluating runng for a small project. I'm on macOS. When I do a fresh compilation of my project, everything is fine. Now, when I'm trying to compile a second time, I get this error:

$ cargo run  
error: checksum for `runng-sys v1.1.1+4` changed between lock files

this could be indicative of a few possible errors:

    * the lock file is corrupt
    * a replacement source in use (e.g. a mirror) returned a different checksum
    * the source itself may be corrupt in one way or another

unable to verify that `runng-sys v1.1.1+4` is the same as when the lockfile was generated

And it doesn't compile

jeikabu commented 5 years ago

I primarily develop on OSX so it's definitely not OS-neglect. =)

Verified this happens for me as well with a new project. Tried a few different combinations and all have the same problem:

runng = "0.1"
runng-sys = "1.1.1"
runng-sys = "1.1.1+4"

In my own projects I tend to use the source rather than pulling the crate (i.e. runng = { version = "0.1", path = "../runng" }), so I'd not noticed this before.

Not sure if this is caused by:

I'll look into this, in the mean time you could git clone and reference the source. Thanks for reporting this.

oysterpack commented 5 years ago

I develop on ubuntu, and ran into the same issue. As an FYI, the nng does not have this issue. Once this issue is resolved, I will give it another try.

jeikabu commented 5 years ago

It seems to be caused by cargo's partial support for semver meta-data. If I un-yank the "1.1.1" crate everything is fine. If I yank "1.1.1" then "1.1.1+4" is pulled and you get the checksum error on second and later builds...

I'll leave "1.1.1" un-yanked so things build correctly from the crate. The only real difference between "1.1.1" and "1.1.1+4" is changes to get docs.rs working; they're both using nng 1.1.1.

With crates being permanent there doesn't seem to be a nice way to mirror the nng version and make trivial changes to crates...

sphinxc0re commented 5 years ago

I'm still getting this error:

$ cargo build             
  Downloaded runng-sys v1.1.1
error: failed to verify the checksum of `runng-sys v1.1.1`

Also, I ran

$ rm -rf target Cargo.lock

before

jake-ruyi commented 5 years ago

sigh it did work with a new project...

I needed to clear out the various ~/.cargo/registry/**/runng* folders to repro this. But now it seems to be a different problem because it refuses to build even the first time.

I'll probably need to open another issue with cargo/crates.io since rust-lang/crates.io#1059 is already over a year old...

jake-ruyi commented 5 years ago

So this also happens with a test package I made (an empty library project). I'll wait for feedback on https://github.com/rust-lang/cargo/issues/6504 before I push more versions.

jeikabu commented 5 years ago

Consensus is in, + build meta-data is verboten. I need to push new packages.

In cargo.toml:

runng-sys = "1.1.1-rc"
# OR
runng = "0.1.8"

I'd really like to keep the version of this aligned with NNG, so here's what seems to work:

sphinxc0re commented 5 years ago

Thanks! It seems to be working

jeikabu commented 5 years ago

Thanks for reporting it. Turns out cargo isn't quite as straight-forward as I thought. =)