Closed oren0e closed 1 year ago
I'm sorry, but this is not a supported usecase. We expect you to be using a ~recent version of Rust.
If you want to stick to an older version of cargo-chef
, you probably want to use the --locked
flag when installing.
@LukeMathWalker Doesn't the project have an MSRV? In our company there are constraints that does not allow me to always use the latest Rust version, nor do I want to update everything every month.
This project does not guarantee an MSRV—it isn't documented anywhere, as you can see from the README.
Even if it did guarantee an MSRV, it still wouldn't work unless you pass --locked
when issuing the cargo install
command.
It's also worth noticing that the version of Rust you use to compile cargo-chef
has nothing to do with the version of Rust you use to compile your own project.
To list a few options:
cargo-chef
in another Docker build stage and then copy the binary over into the stages used to build your application and its dependenciesThank you very much! I wasn't aware of some of these options. Using a pre-built docker actually sounds promising. Will try that out.
@LukeMathWalker sorry for reviving this but could you please provide a small Dockerfile example for how can I use your pre-built docker image (with latest Rust version for example) from docker-hub to "cook" the recipe while using another image of older Rust to actually cargo build --release
my project?
how can I use your pre-built docker image (with latest Rust version for example) from docker-hub to "cook" the recipe while using another image of older Rust to actually cargo build --release my project?
You need to use the same version of Rust in both steps, otherwise there won't be any artifact sharing.
This project does not guarantee an MSRV—it isn't documented anywhere, as you can see from the README. Even if it did guarantee an MSRV, it still wouldn't work unless you pass
--locked
when issuing thecargo install
command.It's also worth noticing that the version of Rust you use to compile
cargo-chef
has nothing to do with the version of Rust you use to compile your own project. To list a few options:* you can compile `cargo-chef` in another Docker build stage and then copy the binary over into the stages used to build your application and its dependencies * you can download a pre-built binary from our GitHub releases (and verify the checksum to ensure integrity) * you can use our pre-built Docker images
@LukeMathWalker I thought this is what you meant here, or did I misunderstood?
I think you misunderstood.
What you use to compile cargo-chef
doesn't matter, but the toolchains must match between building deps and building the project.
Hi, I am using
rustc 1.56.0-nightly (0035d9dce 2021-08-16)
with 2018 edition. I couldn't use the latest cargo-chef anymore so I fixed the version of it to the last one that used 2018 edition. This caused the same edition problem for cargo-manifest, so I've downgraded the cargo-chef version yet again to account for that (version 0.1.40), But of course the chain does not end there - I now receive an error about other dependencies it seems: