Solve issues in docker multi architecture builds (linux/arm/v7, linux/arm64/v8, linux/ppc64le)
linux/arm/v7
It seems this issue depends on the kernel image, we should investigate it further:
# guix error: cloning builder process: Invalid argument (https://lists.gnu.org/archive/html/help-guix/2017-12/msg00023.html)
# { docker: linux/arm/v7, guix: armhf-linux },
Reference: https://lists.gnu.org/archive/html/help-guix/2017-12/msg00023.html
linux/arm64/v8, linux/ppc64le
For OOM, we should find a way to tweak QEMU options and truly investigate if the OOM is reached due to QEMU limits or the VM from GitHub itself. Here's the reference:
# ERROR: failed to solve: ResourceExhausted: process "/bin/sh -c sh -c '/entry-point.sh guix pull ..." did not complete successfully: cannot allocate memory
# { docker: linux/arm64/v8, guix: aarch64-linux },
# { docker: linux/ppc64le, guix: powerpc64le-linux }
Reference: https://github.com/docker/setup-qemu-action https://hub.docker.com/r/tonistiigi/binfmt https://github.com/tonistiigi/binfmt
I’ve attempted several strategies to resolve the multi-architecture build issues, including:
1. Limiting Guix to a single job (Guix=jobs=1)
- In the Dockerfile, I set the
GUIX_JOBSenvironment variable to limit the number of jobs to 1:ENV GUIX_JOBS=1
2. Increasing the swap space to 16GB
- I added a step in the Docker workflow to increase the swap space before running the build:
sudo fallocate -l 16G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile - Verified the swap space with:
swapon --show free -h
3. Setting memory limits to 4GB for Docker containers
- In the Docker run command, I limited the memory to 4GB:
docker run --memory=4g ...
4. Splitting commands in the Dockerfile
- To optimize the build process, I split the
RUNcommands in the Dockerfile to isolate steps and reduce the chance of failures:RUN guix pull RUN guix package --fallback -i nss-certs
5. Commenting out other platforms
- To focus exclusively on
arm64/v8, I commented out the other platforms in the Docker build command:docker buildx build --platform linux/arm64/v8 --push ...
6. Trying different base images
- I tested different base images such as
debian:bookwormanddebian:bookworm-slimby modifying theFROMline in the Dockerfile:
orFROM debian:bookwormFROM debian:bookworm-slim
7. Installing Guix via the official Guix script
- I also attempted to install Guix using the official installation script:
wget https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh sudo bash guix-install.sh
Despite trying all these solutions, the problem is still not resolved. Any further advice or suggestions would be really helpful.
@Bcoderx6 thank you so much for the investigation.
I have added more substitutes, we should try to uncomment it and run it again: