Skip to content

fix(builder): auto-detect Rosetta 2 availability, fall back to QEMU#1826

Open
lohitkolluri wants to merge 1 commit into
apple:mainfrom
lohitkolluri:fix/autodetect-rosetta-availability
Open

fix(builder): auto-detect Rosetta 2 availability, fall back to QEMU#1826
lohitkolluri wants to merge 1 commit into
apple:mainfrom
lohitkolluri:fix/autodetect-rosetta-availability

Conversation

@lohitkolluri

@lohitkolluri lohitkolluri commented Jun 25, 2026

Copy link
Copy Markdown

The builder VM enables Rosetta translation by default for x86_64 builds on Apple Silicon. This crashes when Rosetta 2 is not installed on the host.

Root cause: BuilderStart.swift unconditionally uses containerSystemConfig.build.rosetta (defaults to true) as the Rosetta enable flag for the builder VM. If Rosetta 2 is not installed, the VM creation fails.

Fix: Auto-detect Rosetta 2 at runtime by checking for the Rosetta runtime library at /Library/Apple/usr/libexec/oah/libRosettaRuntime. The builder only enables Rosetta if it's configured AND actually available. When unavailable, QEMU handles cross-architecture builds via --enable-qemu.

Behavior matrix:

Rosetta 2 installed Config rosetta Result
Yes true (default) Rosetta enabled (performance)
No true (default) QEMU fallback (no crash)
Yes/No false QEMU always (user explicit)

Changes:

  • BuilderStart.swift: 1-line change — add && FileManager.default.fileExists(...) check
  • container-system-config.md: document auto-detection behavior
  • how-to.md: update Rosetta section to explain auto-detection

AI disclosure: Assisted by Claude Code (Claude Opus 4.8)

Closes #1825

The builder VM enables Rosetta translation by default for x86_64 builds on
Apple Silicon. This crashes when Rosetta 2 is not installed on the host.

Auto-detect Rosetta 2 availability by checking for the Rosetta runtime
library. If it's not installed, fall back to QEMU via --enable-qemu
instead of failing.

Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
@lohitkolluri lohitkolluri force-pushed the fix/autodetect-rosetta-availability branch from e894e1f to 1360d6b Compare June 27, 2026 19:43
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.

[Request]: Buildkit should work without Rosetta 2

1 participant