4 ms·
One thing I ran into when I was trying to compile something after it wasn’t touched for a year or so is that cargo doesn’t in-fact look at its lock file what mi
by pilif 5y ago
One thing I ran into when I was trying to compile something after it wasn’t touched for a year or so is that cargo doesn’t in-fact look at its lock file what minor versions is concerned.
This caused cargo to install different minor versions than it would have a year ago despite a lock file being present.
These minor version updates were relying on newer rust version features and then failed to build on the old version of the rust compiler I was using.
Updating rust made the build work again, but now with additional warnings (where the code I was compiling did shady things which old rust wouldn’t detect but new one did), but it did finally produce a usable binary.
Still, I was a bit miffed by cargos behavior of ignoring minor versions locks in the lock file and installing later versions than what was locked.
What good is a package lock file if it isn’t respected?
- steveklabnik 5y agoThat very very very much sounds like a bug, one that I’ve never heard of before. You don’t happen to have that project lying around, do you?
- dochtman 5y agoI think I’ve noticed that cargo install would pick up newer semver-compatible versions than what was in the lockfile unless I passed —-locked explicitly, which seemed surprising to me.
- steveklabnik 5y agoAh yeah if we’re talking about cargo install, then sure. That would make sense. Both behaviors can be surprising. We picked one. It happens. I am not sure myself if it was the right choice or not.
- follower 5y agoIt sounds little bit like the (known) situation around cargo where it doesn't default to `--locked` and so results in surprising behaviour for many people. This particular issue is in regard to `cargo install`: https://github.com/rust-lang/cargo/issues/7169 https://github.com/rust-lang/cargo/issues/7169 Oh, or, I guess, it might be how the version is specified--guess we need some more details on what "compile something after it wasn’t touched for a year" entailed.
- steveklabnik 5y agoOh, yes, with cargo install that is the case. They just said “cargo”. That would make more sense, yes.
- deleted 5y ago[deleted]