To add an aarch64 image to the Docker image norionomura/swiftlint, I encountered an issue while creating an aarch64 executable using the x86_64 version of the Swift Toolchain on GitHub Actions' ubuntu-latest. The final verification step was to use aarch64 emulation with qemu-user-static, where the issue arose. This issue occurs not only with the Swift compiler but also with executables created with Swift, such as swiftlint.
Upon investigation, it was found that the issue can be avoided by using a specific version of qemu-user-static. For GitHub Actions' ubuntu-latest, the easiest way to avoid this issue is to apply the following change:
- - uses: docker/setup-qemu-action@v3
+ - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
This change installs the same version of qemu-user-static 7.2.0 series provided for Debian Bookworm onto a rootful Docker host.
I investigated which versions of qemu-user-static cause crashes or hang-ups with the aarch64 version of swiftlint:
The addition of the aarch64 image to the Docker image norionomura/swiftlint can be found here:
I am using Docker's multi-stage bind mounts to utilize the official Swift Docker image as the Swift SDK and perform aarch64 cross-builds.
I hope this information is helpful.