Build zmx as a universal macOS binary so Intel Macs can launch terminals#360
Merged
Conversation
v0.10.0 shipped an arm64-only `zmx` helper inside an otherwise universal
`supacode.app`, so every terminal on Intel Macs failed to start with
"bad CPU type in executable" the moment Ghostty execed the bundled
helper.
Cross-compile zmx for both `x86_64-macos` and `aarch64-macos`, `lipo`
the slices into a single universal binary at `.build/zmx/bin/zmx`, and
fail the build with a `-verify_arch` assertion if either slice ever
goes missing. Per-slice prefixes/caches mean incremental rebuilds stay
fast; the existing fingerprint short-circuit still gates rebuilds.
Also drop the legacy `${zmx_build_root}/.zig-cache` directory left
behind by the previous single-target layout so upgraded checkouts
reclaim the orphaned disk usage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zmxhelper inside an otherwise universalsupacode.app, so every terminal on Intel Macs failed to start withbad CPU type in executablethe moment Ghostty execed the bundled helper.x86_64-macosandaarch64-macos,lipothe slices into a single universal binary at.build/zmx/bin/zmx, and fail the build with a-verify_archassertion if either slice ever goes missing. Per-slice prefixes/caches keep incremental rebuilds fast; the fingerprint short-circuit still gates rebuilds.${zmx_build_root}/.zig-cachedirectory left behind by the previous single-target layout so upgraded checkouts reclaim the orphaned disk usage.Test plan
make build-appsucceeds on arm64 host.file .build/zmx/bin/zmxreportsMach-O universal binary with 2 architectures: [x86_64] [arm64].file supacode.app/Contents/Resources/zmx/zmx(Debug bundle) reports the same.build-zmx.shshort-circuits in ~90 ms.lipo -verify_archexits non-zero with a printed locator when fed a thin slice.Close #359