Commit Graph
1 Commits
Author SHA1 Message Date
Mao NakamotoandClaude Opus 4.7 60b828ac98 fix(desktop): v0.4.3 — afterPack wraps Electron binary with --no-sandbox stub
v0.4.2 set linux.executableArgs: ["--no-sandbox"] but verification on a
fresh AppImage download showed it STILL crashed at FATAL setuid_sandbox_host.
Inspected the generated AppRun script and confirmed the flag was missing:
electron-builder only injects executableArgs into the .desktop file's
Exec= line, not the AppRun. So OS-menu launches via .desktop worked but
direct execution of the AppImage (double-click, ./binary from a shell,
electron-updater swap) did not.

Fix: a custom afterPack hook (desktop/scripts/afterPack.cjs) wraps the
real Electron binary in a small shell stub that bakes --no-sandbox into
argv before exec'ing the real binary. The AppRun unknowingly invokes the
wrapper, which in turn invokes the real binary with the flag. This is
the pattern Slack, Discord, VSCode, Cursor, and Obsidian all use.

Layout in appOutDir after afterPack:
  fleet-runner      ← bash wrapper (new, 0755)
  fleet-runner-bin  ← real Electron binary (renamed from fleet-runner)

Idempotent: skips if -bin already exists, so multi-arch builds don't
double-wrap. Scoped to electronPlatformName === 'linux'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 18:23:07 +02:00