fix(appimage): drop injected --no-sandbox in the Linux launcher wrapper#267
Open
sproctor wants to merge 1 commit into
Open
fix(appimage): drop injected --no-sandbox in the Linux launcher wrapper#267sproctor wants to merge 1 commit into
sproctor wants to merge 1 commit into
Conversation
electron-builder's AppImage AppRun prepends --no-sandbox to the launched binary when unprivileged user namespaces are unavailable (the Ubuntu 24.04+ default), on the assumption the target is Chromium/Electron. Nucleus packages JVM/native apps that have no such sandbox, and their launchers may abort on the unknown option. AppRun execs "$APPDIR/<executableName>", which is the wrapper script Nucleus generates in ensureLinuxExecutableAlias, so drop --no-sandbox there before delegating to the real launcher. This needs no AppImage repackaging, leaves electron-builder's auto-update hash/blockmap intact, and covers both the jpackage and GraalVM launchers. Co-Authored-By: Claude Opus 4.8 (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.
Problem
AppImages built by Nucleus fail to launch on Ubuntu 24.04+ (and any host where unprivileged user namespaces are restricted):
Fixes #266.
Root cause
Nucleus packages the AppImage via electron-builder. electron-builder's generated
AppRunprepends--no-sandboxto the launched binary whenunshare -Ur truefails (i.e. unprivileged user namespaces are unavailable, the Ubuntu 24.04+ default), on the assumption the binary is Chromium/Electron:But Nucleus packages JVM / GraalVM-native apps, which have no Chromium sandbox and whose launchers may abort on the unknown option.
There is no electron-builder configuration to disable this: the injection is hardcoded in
generateAppRunScript, theAppRunis rewritten on every build, andlinux.executableArgscan only add arguments (it cannot remove--no-sandbox).Fix
AppRunexecs"$APPDIR/<executableName>", which is the launcher wrapper Nucleus already generates inensureLinuxExecutableAlias(it resolves symlinks and delegates to the realbin/<launcher>). This drops--no-sandboxin that wrapper before delegating:Chosen here because it:
sha512, and.blockmapuntouched, so auto-update metadata stays valid;Alternatives considered
.AppImageto rewriteAppRun: requires extract + repackage tooling and would invalidate the auto-updatesha512/.blockmapelectron-builder just generated.Testing
The POSIX
shrebuild idiom preserves argument order and arguments containing spaces; only exact--no-sandboxtokens are removed.