-
Notifications
You must be signed in to change notification settings - Fork 116
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
cargo chef
appears to ignore Cargo.lock
#252
Comments
cargo chef
ignore Cargo.lock
?cargo chef
appears to ignore Cargo.lock
This is to workaround a bug(?) in `cargo chef` where the lockfile isn't taken into account. This is currently blocking the interop tests. Related: #5118. Related: LukeMathWalker/cargo-chef#252.
I've tried to reproduce what you're describing but with no luck. I've tried to do this to create a lock file with your dependency at 0.2.7 and the lock file has been correctly recreated in the second directory.
Your project also seems to handle the identity crate specially with a crates.io override in the workspace When you run the build after |
Yes i got this issue too, I try to pass > [builder 3/10] RUN cargo chef cook --release --recipe-path recipe.json --locked:
0.471 Updating crates.io index
5.371 error: the lock file /usr/src/Cargo.lock needs to be updated but --locked was passed to prevent this
5.371 If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.
5.384 thread 'main' panicked at 'Exited with status code: 101', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-chef-0.1.62/src/recipe.rs:204:27
5.384 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace |
The identity crate is part of the workspace. It is a bit messy and you might be right that it is the cause of the issue. What might happen is that because it is patched without a I don't have to bandwidth to debug this further unfortunately and we've solved the problem in a different way for now. Feel free to close this issue from my end. |
I didn't understand the comment regarding the identity package the first time I read it, sorry for the confusion! Now I think the issue is with So I think this issue is about crates.io overrides. @muhammad-asn do you also use these? |
I've also got the issue trying to build docker image for https://github.com/predibase/lorax from main branch:
|
@markovalexander I think your issue is #231, cargo-chef currently does not handle rust-toolchain file so the cook command uses the installed toolchain, which in your case is 1.70. You can either update the base docker image to be the same version as the toolchain you use (this will also save you some time in CI because then cargo and rustup don't have to download the correct toolchain) or you can just copy the toolchain file into the container before running the cook command. |
Somehow I update my rust tool-chain with version |
@mladedav I am not sure that this is the case
yes, it is an expected behaviour. What is not expected is that Updating rust to 1.74 is not a solution: it helps to build an image but when running it you'll get an instant crash because of this. |
@markovalexander I've tried copying the rust-toolchain fail into the container before running In any case you might also want to just use a rust image with the correct toolchain and glibc (such as |
I have the following
Dockerfile
: https://github.com/libp2p/rust-libp2p/blob/v0.52/interop-tests/Dockerfile.native.Recently, we released a new version of
libp2p-identity
, version0.2.8
. That one raises the MSRV in a patch-version. Not necessarily best practice but that is not the point.If you download the source code above for the
v0.52
tag and try to build the Dockerfile using:sudo docker build -f interop-tests/Dockerfile.native .
It will fail with:
If you change the Dockerfile to the following (i.e. comment out
cargo chef
):it suddenly works.
The
Cargo.lock
for thev0.52
tag points tolibp2p-identity 0.2.7
which has an MSRV of 1.63 and therefore compiles with the old Dockerfile. It appears thatcargo chef
ignoresCargo.lock
. Is that intended?The text was updated successfully, but these errors were encountered: