Skip to content

fix(build): register current QEMU and compile pwru with clang - #2676

Merged
Quang Nguyen (nddq) merged 2 commits into
mainfrom
nddq/pwru-clang-qemu
Aug 25, 2026
Merged

fix(build): register current QEMU and compile pwru with clang#2676
Quang Nguyen (nddq) merged 2 commits into
mainfrom
nddq/pwru-clang-qemu

Conversation

@nddq

@nddq Quang Nguyen (nddq) commented Aug 21, 2026

Copy link
Copy Markdown
Member

Description

The ADO pipeline builds the arm64 shell image on amd64 agents under QEMU. The pwru source build (#2675) runs real compilers inside that stage, and modern aarch64 binaries crash under the old QEMU: gcc cc1 died with an internal compiler error, and gawk segfaulted inside the libpcap configure. Every merge-queue CI (Build Images) run failed at Build Retina Shell Images arm64.

Two changes:

  • Current QEMU: the qemu-user-static make target registered multiarch/qemu-user-static, which ships a QEMU from 2022. It now registers tonistiigi/binfmt, which ships a current QEMU. docker/setup-qemu-action uses the same image, so the GitHub Actions builds never saw these crashes.
  • clang: the pwru build compiles with clang. clang builds the same static binary under QEMU, and one compiler serves both architectures.

The org's hosted ADO pool offers no arm64 images, and the OneBranch arm64 pool rejects pipelines that do not extend the OneBranch governed template. Native ADO arm64 therefore needs a OneBranch migration, which stays out of scope.

Related Issue

N/A.

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Screenshots (if applicable) or Testing Completed

  • Local QEMU emulation with current QEMU (tonistiigi/binfmt): the arm64 stage builds, and the startup check prints pwru v1.0.12 from the emulated binary. The extracted binary is a static ELF with go1.26.7.
  • ADO run 124172 isolated the old QEMU as the cause: with clang alone, gawk still segfaulted under the old QEMU.
  • The ADO PR run on this branch passes Build Retina Shell Images arm64 with both changes.

Additional Notes

N/A.

The ADO pipeline builds the arm64 shell image under QEMU. gcc cc1
crashes there with an internal compiler error, so the pwru source
build fails. clang compiles and links the same static binary under
QEMU without a crash. Both architectures build with clang, so one
compiler serves both.

Signed-off-by: Quang Nguyen <28567936+nddq@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Retina Code Coverage Report

Total coverage no change

Increased diff

Impacted Files Coverage
pkg/controllers/daemon/namespace/namespace_controller.go 76.24% ... 78.46% (2.22%) ⬆️

The qemu-user-static make target registered multiarch/qemu-user-static,
which ships a QEMU from 2022. Modern aarch64 binaries crash under it:
gcc cc1 died with an internal compiler error, and after the clang
switch, gawk segfaulted inside the libpcap configure. tonistiigi/binfmt
ships a current QEMU and is what docker/setup-qemu-action uses, so the
GitHub Actions builds never saw these crashes.

Signed-off-by: Quang Nguyen <28567936+nddq@users.noreply.github.com>
@nddq Quang Nguyen (nddq) changed the title fix(shell): compile pwru with clang fix(build): register current QEMU and compile pwru with clang Aug 23, 2026
@nddq
Quang Nguyen (nddq) added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit d2b0d23 Aug 25, 2026
45 checks passed
@nddq
Quang Nguyen (nddq) deleted the nddq/pwru-clang-qemu branch August 25, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants