Conversation
bun build --compile embeds @gpuix/native's .node in the executable, so every .app launch after $TMPDIR is purged re-extracts it and re-pays a Gatekeeper scan. compile-chat.ts now compiles the .app's executable with --external '*.node' and a small entry shim that points NAPI_RS_NATIVE_LIBRARY_PATH — checked first by napi-rs's generated loader — at the addon shipped in Contents/Frameworks, ad-hoc signing both. Bare `bun build --compile --production` binaries are unaffected and keep embedding the addon. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Harness: Claude Code
Agent: none
Model: anthropic/claude-opus-5
Task statements
Compare this fork with a public benchmark of one Mac app built in 21 frameworks, and bring startup closer to plain GPUI. (Working-directory and workflow instructions omitted.)
Settle where shipped apps keep the native addon so macOS stops rescanning it. (Working-directory and workflow instructions omitted.)
Closes #601.
The chat example's
.appnow ships the native addon inContents/Frameworksinstead of embedding it in the executable. An embedded addon is written to$TMPDIR/.bun-*.nodeand scanned by macOS on the first launch and again after every$TMPDIRpurge (342 ms scan, 620–665 ms launches in #601). The barebun build --compile --productionbinary still embeds it.The executable is compiled from a generated entry that points napi-rs's loader at the bundled file, then loads the app. The README's "Wrap it in an app" section shows the same six lines for app authors:
NAPI_RS_NATIVE_LIBRARY_PATHis the first path the generatedpackages/native/index.jsloader checks.--external '*.node'stops Bun from embedding the addon at bundle time; without it the addon is embedded and extracted whatever the variable says. The app is resealed withcodesign --force --deep --sign -after the addon is in place.main.appexecutable.bun-*.nodewritten to$TMPDIRon launchThe app opens through
open -W -nand renders. Notarisation is not tested: there is no Developer ID certificate available. The README's cargo-packager variant copies and signs the addon aftercargo packagerruns; that sequence was not run end to end because cargo-packager is not installed here.Risk: apps that follow the old README keep working, still embedding the addon. Reverting the commit restores the embedded layout.
🤖 Generated with Claude Code