Summary
Opening a built production Electrobun app for the first time increases the app's size while it self-unpacks an internal <hash>.tar.zst artifact. This can cause first-launch to fail until second launch when it takes too long, or to fail permanently if storage is full. It doesn't unpack until first launch.
In my case, it made an Electrobun app 4x bigger after opening it for the first time. From an end-user perspective, this breaks the expectation that the .app in the .dmg is already the size needed to install by dragging into the Applications folder.
Observed
- In non-dev macOS builds, the shipped
.app is a wrapper containing Contents/Resources/<hash>.tar.zst.
- On first launch, it unpacks into the bundle (new files under
Contents/MacOS and Contents/Resources/app).
- App size increases after first open, and first launch takes longer.
- This can fail on low free disk, because install-time footprint is smaller than steady-state footprint.
Expected
- A copied
.app should be in its final on-disk state at install time (or at least offer a mode for that).
- No silent first-launch extraction that mutates bundle contents and changes app size.
Repro
- Build a minimal Electrobun app with non-dev env (
build --env=stable or equivalent production env).
- Before first run:
du -sh "/Volumes/My App/My App.app"
ls "/Volumes/My App/My App.app/Contents/Resources" (contains <hash>.tar.zst)
- Copy to Applications and launch once:
cp -R "/Volumes/My App/My App.app" "/Applications/My App.app"
open "/Applications/My App.app"
- After first run:
du -sh "/Applications/My App.app" (larger)
Contents/MacOS and Contents/Resources/app now contain extracted runtime files.
Suggestion
What do you think of adding an ElectrobunConfig option to disable self-extract packaging on macOS (ship fully expanded bundle; skip creating/extracting .tar.zst)?
Context (Apple docs)
Additional Information
- Electrobun 1.16.0
- Bun 1.3.11 macOS Silicon
- macOS 26.3.1
Summary
Opening a built production Electrobun app for the first time increases the app's size while it self-unpacks an internal
<hash>.tar.zstartifact. This can cause first-launch to fail until second launch when it takes too long, or to fail permanently if storage is full. It doesn't unpack until first launch.In my case, it made an Electrobun app 4x bigger after opening it for the first time. From an end-user perspective, this breaks the expectation that the
.appin the.dmgis already the size needed to install by dragging into the Applications folder.Observed
.appis a wrapper containingContents/Resources/<hash>.tar.zst.Contents/MacOSandContents/Resources/app).Expected
.appshould be in its final on-disk state at install time (or at least offer a mode for that).Repro
build --env=stableor equivalent production env).du -sh "/Volumes/My App/My App.app"ls "/Volumes/My App/My App.app/Contents/Resources"(contains<hash>.tar.zst)cp -R "/Volumes/My App/My App.app" "/Applications/My App.app"open "/Applications/My App.app"du -sh "/Applications/My App.app"(larger)Contents/MacOSandContents/Resources/appnow contain extracted runtime files.Suggestion
What do you think of adding an
ElectrobunConfigoption to disable self-extract packaging on macOS (ship fully expanded bundle; skip creating/extracting.tar.zst)?Context (Apple docs)
Additional Information