fix: Remove --bytecode flag to fix Mach-O signing corruption on M4#43
Closed
alfep wants to merge 1 commit into
Closed
fix: Remove --bytecode flag to fix Mach-O signing corruption on M4#43alfep wants to merge 1 commit into
alfep wants to merge 1 commit into
Conversation
The --bytecode flag in bun build --compile produces structurally corrupted Mach-O binary headers on Apple Silicon (M4), causing macOS Gatekeeper to SIGKILL the process. Removing the flag restores standard binary format compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Removes Bun’s --bytecode compilation flag from the build pipeline to avoid producing Mach-O binaries that macOS Gatekeeper/code-signing tools treat as structurally invalid on Apple Silicon (M4), addressing the immediate “zsh: killed” runtime failure described in #29.
Changes:
- Drop
--bytecodefrom thebun build --compilecommand assembled inscripts/build.ts.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Remove
--bytecodefromscripts/build.tsto fix Mach-O binary corruptionon Apple Silicon (M4). The bytecode flag produces structurally corrupted binary
headers, causing macOS Gatekeeper to SIGKILL the process immediately.
Root Cause
bun build --compile --bytecodeinjects bytecode alongside the native Mach-Obinary. On modern Apple Silicon, this bytecode overlay corrupts the code-signing
layout enforced by the macOS kernel. Gatekeeper rejects the malformed signature
and kills the process — hence the
zsh: killedcrash.Fix
Removing
--bytecoderestores standard binary format compatibility. The binarystill compiles and minifies correctly — bytecode is an optimization layer
unnecessary for clean Mach-O output.
Test
file ./dist/cli→Mach-O 64-bit executable arm64codesign --force --deep -s - ./dist/cli→ succeeds (previouslyinvalid or unsupported format)./dist/cli /login→ no SIGKILLRelated
Closes #29
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com