From efff828746b17854ddc74b6cbb5fe7cebc40d924 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Fri, 18 Sep 2026 14:56:03 -0400 Subject: [PATCH] Builders emulate aarch64 with QEMU 10.2.3 instead of the abandoned 7.2 image multiarch/qemu-user-static stopped at QEMU 7.2 (January 2023). Under it, qmake's compiler probe (`g++ -E -v` in toolchain.prf) returns nothing on the current gcc 16 toolchain, so every qmake package fails on aarch64 with "failed to parse default include paths from compiler output" (hype, PR #517). The same PKGBUILD builds under QEMU 10.2.3 and 11.1. Register through tonistiigi/binfmt at a pinned tag, on both the ephemeral builder droplets and the rootful-Docker path of setup_qemu, uninstalling any existing entry first because the tool keeps an older registration in place. The tag is now the one place that decides what every emulated build runs under. Flags stay F and C, which rootless sudo inside the builder needs. --- ci/runner-cloud-init.yaml | 14 +++++++++----- helpers/docker-helpers.sh | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ci/runner-cloud-init.yaml b/ci/runner-cloud-init.yaml index c2db181..c05e32e 100644 --- a/ci/runner-cloud-init.yaml +++ b/ci/runner-cloud-init.yaml @@ -68,10 +68,14 @@ runcmd: - chage -d "$(date +%F)" -M -1 root - systemctl enable --now docker # aarch64 builds run under user-mode emulation (DO has no arm droplets). - # Register QEMU with the F and C flags via the multiarch image, exactly as - # helpers/docker-helpers.sh setup_qemu does: Ubuntu's qemu-user-static - # package registers without C, so sudo inside the emulated container fails - # with "effective uid is not 0". Best-effort: an x86-only job never needs it. - - docker run --rm --privileged docker.io/multiarch/qemu-user-static --reset -p yes --credential yes || true + # Register QEMU with the F and C flags via tonistiigi/binfmt, exactly as + # helpers/docker-helpers.sh setup_qemu does. Ubuntu's qemu-user-static + # registers without C, so sudo inside the emulated container fails with + # "effective uid is not 0"; multiarch/qemu-user-static is abandoned at QEMU + # 7.2, under which qmake's compiler probe returns nothing on current gcc + # ("failed to parse default include paths", PR #517). Pin the emulator + # version: the tag is the only thing that decides what every aarch64 build + # runs under. Best-effort: an x86-only job never needs it. + - docker run --rm --privileged docker.io/tonistiigi/binfmt:qemu-v10.2.3-68 --uninstall qemu-aarch64 --install arm64 || true - chown -R runner:runner /home/runner - sudo -u runner /home/runner/start.sh > /home/runner/runner.log 2>&1 diff --git a/helpers/docker-helpers.sh b/helpers/docker-helpers.sh index cc18222..22c8004 100644 --- a/helpers/docker-helpers.sh +++ b/helpers/docker-helpers.sh @@ -91,8 +91,19 @@ setup_qemu() { exit 1 fi - # Register emulators for builds whose target differs from the host. - if ! "$CONTAINER_ENGINE" run --rm --privileged docker.io/multiarch/qemu-user-static --reset -p yes --credential yes >/dev/null 2>&1; then + # Register emulators for builds whose target differs from the host, with + # the F and C flags (tonistiigi/binfmt always sets both). The image tag pins + # the QEMU version every emulated build runs under; multiarch/qemu-user-static + # stopped at QEMU 7.2, which breaks qmake's compiler probe on current gcc. + # Keep ci/runner-cloud-init.yaml on the same tag. Uninstall first: install + # leaves an existing registration (an older emulator) in place and exits 0. + local platform_arch + case "$target_arch" in + aarch64) platform_arch=arm64 ;; + x86_64) platform_arch=amd64 ;; + *) platform_arch="$target_arch" ;; + esac + if ! "$CONTAINER_ENGINE" run --rm --privileged docker.io/tonistiigi/binfmt:qemu-v10.2.3-68 --uninstall "qemu-$target_arch" --install "$platform_arch" >/dev/null 2>&1; then print_error "Failed to set up QEMU emulation" exit 1 fi