Skip to content

fix(sandbox): build the universal VM helper on Command Line Tools 27 - #381

Merged
quickbeard merged 1 commit into
mainfrom
fix/vmm-universal-build
Sep 25, 2026
Merged

quickbeard merged 1 commit into
mainfrom
fix/vmm-universal-build

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Summary

Follow-up to #380. That PR fixed the host-arch helper build used by bun dev:desktop. Release packaging (prebuild.ts → build-vzhelper.ts --universal) still failed on Command Line Tools 27 / Swift 6.4, so macOS releases had to be built by hand.

Why the Intel slice failed. The helper's .macOS(.v12) deployment target links Swift's back-compatibility libraries:

  • libswiftCompatibility56 supplies runtime fixes for macOS 12.0–12.2.
  • libswiftCompatibilityPacks also gets linked.

This toolchain ships every compatibility library as arm64 arm64e only (checked with lipo -archs on all six), so the x86_64 link failed:

ld: warning: ignoring file …/libswiftCompatibility56.a: fat file missing arch 'x86_64', file has 'arm64,arm64e'
ld: warning: ignoring file …/libswiftCompatibilityPacks.a: fat file missing arch 'x86_64', file has 'arm64,arm64e'
Undefined symbols for architecture x86_64

Fix. When the toolchain's libswiftCompatibility56.a has no x86_64 slice, the Intel slice is built with -Xswiftc -runtime-compatibility-version -Xswiftc none, which leaves the compatibility libraries out.

  • The arm64 slice is unchanged and keeps them.
  • A toolchain that still ships Intel copies (e.g. Xcode 26 on CI) keeps them for Intel too.
  • The only cost is on Intel Macs running macOS 12.0–12.2 (sandboxes require macOS 12+), where the helper runs without those runtime fixes. Every other Mac is unaffected.

It also quiets the first swift build attempt before the --build-system native retry from #380. A successful build used to log the default backend's full error; now it logs one line, and a failing retry still prints its own error.

packages/codev-sandbox is fork-only, so no DIVERGENCES.md row.

Test plan

  • Clean --universal build on CLT 27 / Swift 6.4 (.build and dist removed first): succeeds in ~70 s. lipo -archs → x86_64 arm64, signed with com.apple.security.virtualization.
  • nm per slice: arm64 still carries the swiftCompatibility symbols (2), x86_64 has none.
  • Host-arch build (the predev path) unchanged: arm64 only.

🤖 Generated with Claude Code

Release packaging (desktop prebuild → build-vzhelper.ts --universal)
failed on Command Line Tools 27 / Swift 6.4: the helper's macOS 12
deployment target links Swift's back-compatibility libraries
(libswiftCompatibility56, libswiftCompatibilityPacks), and this toolchain
ships every one of them for arm64/arm64e only, so the x86_64 slice failed
to link ("fat file missing arch 'x86_64'", undefined symbols). macOS
releases had to be built by hand.

When the toolchain's libswiftCompatibility56.a has no x86_64 slice, the
Intel slice is now built with `-runtime-compatibility-version none`. The
arm64 slice keeps the libraries, and a toolchain that still ships Intel
copies keeps them for Intel too; the only cost is Intel Macs on macOS
12.0–12.2 running the helper without those runtime fixes.

Also quiets the failed first attempt on the default build system before
the `--build-system native` retry (#380), so a successful build no longer
logs a wall of errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 1f0ee9d into main Sep 25, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the fix/vmm-universal-build branch September 25, 2026 10:35
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.

1 participant