#3729·youki

Cross-build for musl

Author: t-akashiCreated Sep 15, 2026Updated Sep 17, 2026

According to docs/src/user/basic_setup.md, we should be able to build, for example, musl binary with: $ CARGO=cross TARGET=musl just youki-release This commands fails with the following message:

Error: 0: could not run container 1: when building custom image 2: when building dockerfile 3: docker build --label 'org.cross-rs.for-cross-target=x86_64-unknown-linux-musl' --label 'org.cross-rs.workspace_root=/home/akashi/work/youki' --tag cross-custom-youki:x86_64-unknown-linux-musl-d871d --build-arg 'CROSS_DEB_ARCH=musl-linux-amd64' --build-arg 'CROSS_BASE_IMAGE=ghcr.io/cross-rs/x86_64-unknown-linux-musl:0.2.5' --file cross/Dockerfile.musl '--progress=plain' /home/akashi/work/youki failed with exit status: 1

The reason is that CROSS_CMAKE_SYSTEM_PROCESSOR, hence MARCH, is not defined in cross/Dockerfile.musl and then "apk add alpine-keys" fails. Based on the comment in this file, it is assumed that CROSS_CMAKE_SYSTEM_PROCESSOR variable is defined in the specified base image, say x86_64-unknown-linux-musl:0.2.5, and to be inherited here, but actually it's not.

If I temporarily add the definition in Dockerfile,say ENV CROSS_CMAKE_SYSTEM_PROCESSOR=x86_64 the cross-build succeeds without any error. exact same against aarch64, too.

I think Dockerfile.musl should be updated to make the variable, rather MARCH, properly set. Do I miss anything in cross-building?