Skip to content

Conversation

@jglogan
Copy link
Contributor

@jglogan jglogan commented Nov 6, 2025

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

The shim wasn't doing everything needed to ensure the use of Rosetta for container build. The new shim adds an --enable-qemu option that controls whether `buildkit-qemu-emulator-x86_64 is available; when it is not available, buildkitd will attempt to build natively, meaning Rosetta will execute amd64 binaries.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@jglogan
Copy link
Contributor Author

jglogan commented Nov 6, 2025

Local tests

With container builder start --cpu 8 --memory 32g:

% container exec -it buildkit sh ps -ef
PID   USER     TIME  COMMAND
    1 root      0:08 /usr/local/bin/container-builder-shim --debug --vsock
   10 root      0:12 /usr/bin/buildkitd
   48 root      0:00 sh
  151 root      0:00 /usr/bin/buildkit-runc --log /var/lib/buildkit/runc-overlayfs/executor/runc-log.json --log-format json run --bundle /var/lib/buildkit/runc-overlayfs/executor/zedpr5mw5zq7nkcpqc0jqneo7 --keep zedpr5mw5zq7nkcpqc
  165 root      0:15 {dnf} /run/rosetta/rosetta /usr/bin/python3.9 /usr/bin/dnf module enable nodejs:22 -y
  182 root      0:00 ps -ef

With container builder start --cpu 8 --memory 32g --enable-qemu:

% container exec -it buildkit sh ps -ef
PID   USER     TIME  COMMAND
    1 root      0:07 /usr/local/bin/container-builder-shim --debug --vsock --platform linux/arm64,linux/amd64
   11 root      0:12 /usr/bin/buildkitd
   34 root      0:00 sh
  169 root      0:00 /usr/bin/buildkit-runc --log /var/lib/buildkit/runc-overlayfs/executor/runc-log.json --log-format json run --bundle /var/lib/buildkit/runc-overlayfs/executor/scpd0rp5ol1sdoiif8olzseim --keep scpd0rp5ol1sdoiif8
  183 root      0:02 {exe} .buildkit_qemu_emulator -0 dnf /usr/bin/dnf module enable nodejs:22 -y
  199 root      0:00 ps -ef

- Addresses slow cross-platform builds from apple#68.
@jglogan jglogan merged commit 384e3a1 into apple:main Nov 6, 2025
3 of 4 checks passed
@jglogan jglogan deleted the shim-0.7.0 branch November 6, 2025 21:29
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