-
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
toolchain in recipe.json is ignored in cargo chef cook
#271
Comments
1 task
I applied a work-around for this by manually copying the toolchain file before invoking
If there are any hidden implications to this i do not know... but at least it gets used during the builds in the cook step :) PS: This might actually be connected to #231 |
This was referenced Oct 5, 2024
LtdSauce
added a commit
to LtdSauce/git-cliff
that referenced
this issue
Oct 11, 2024
This commit adds the known names of the rust-toolchain files to the .dockerignore file. This has three reasons why it makes sense: - The initial docker layer already has a set up rust toolchain that is sufficient to build the project. Thus, by providing a toolchain file, the toolchain would be installed again during docker build. - Currently cargo-chef only copies the toolchain files during cooking but it gets not used during the building of the dependencies in the cook call, see LukeMathWalker/cargo-chef#271. With this in mind, currently the dependencies were actually build twice. Once with the installed toolchain from the image itself, and then in the actual cargo build call with the toolchain speciefied in the toolchain file. Building them twice resulted in timeouts when building the arm64 images as they are emulated using qemu, which is itself already slower than building natively. Now one could argue, that as soon as the mentioned issue is solved using the toolchain again would be fine. But then it would be still needed to assemble the Dockerfile in a way that the toolchain is not build twice. Because the current structure of the Dockerfile builds the toolchain once in the cargo-chef prepare step and once during the cargo build step (and would later build it during the cargo-chef cook instead of cargo build). With all this in mind using no toolchain file but instead just using the sufficient rust installation from the base image makes sense.
LtdSauce
added a commit
to LtdSauce/git-cliff
that referenced
this issue
Oct 14, 2024
This commit adds the known names of the rust-toolchain files to the .dockerignore file. This has two reasons why it makes sense: - The initial docker layer already has a set up rust toolchain that is sufficient to build the project. Thus, by providing a toolchain file, the toolchain would be installed again during docker build. - Currently cargo-chef only copies the toolchain files during cooking but it gets not used during the building of the dependencies in the cook call, see LukeMathWalker/cargo-chef#271. With this in mind, currently the dependencies were actually build twice. Once with the installed toolchain from the image itself, and then in the actual cargo build call with the toolchain speciefied in the toolchain file. Building them twice resulted in timeouts when building the arm64 images as they are emulated using qemu, which is itself already slower than building natively. Now one could argue, that as soon as the mentioned issue is solved using the toolchain again would be fine. But then it would be still needed to assemble the Dockerfile in a way that the toolchain is not build twice. Because the current structure of the Dockerfile builds the toolchain once in the cargo-chef prepare step and once during the cargo build step (and would later build it during the cargo-chef cook instead of cargo build). With all this in mind using no toolchain file but instead just using the sufficient rust installation from the base image makes sense.
orhun
pushed a commit
to orhun/git-cliff
that referenced
this issue
Oct 17, 2024
* chore(docker): ignore rust toolchain in docker builds This commit adds the known names of the rust-toolchain files to the .dockerignore file. This has two reasons why it makes sense: - The initial docker layer already has a set up rust toolchain that is sufficient to build the project. Thus, by providing a toolchain file, the toolchain would be installed again during docker build. - Currently cargo-chef only copies the toolchain files during cooking but it gets not used during the building of the dependencies in the cook call, see LukeMathWalker/cargo-chef#271. With this in mind, currently the dependencies were actually build twice. Once with the installed toolchain from the image itself, and then in the actual cargo build call with the toolchain speciefied in the toolchain file. Building them twice resulted in timeouts when building the arm64 images as they are emulated using qemu, which is itself already slower than building natively. Now one could argue, that as soon as the mentioned issue is solved using the toolchain again would be fine. But then it would be still needed to assemble the Dockerfile in a way that the toolchain is not build twice. Because the current structure of the Dockerfile builds the toolchain once in the cargo-chef prepare step and once during the cargo build step (and would later build it during the cargo-chef cook instead of cargo build). With all this in mind using no toolchain file but instead just using the sufficient rust installation from the base image makes sense. * Revert "chore(docker): disable building arm64 docker images temporarily (#879)" This reverts commit cde2a8e. Commit 73f75d5 made it possible to build the arm64 image again without running into timeouts.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cargo chef cook
generates rust-toolchain.toml file, but it's not used in the subsequent build of dependencies.rust-toolchain.toml takes effect when
cargo
is invoked next time. Therefore, executingcargo chef cook
twice results in building with the wrong toolchain for the first time and the correct building for the second time.The following Dockerfile reproduces the problem.
The text was updated successfully, but these errors were encountered: