Fix AppImage owned runtime sandbox argument injection - #2940
Open
ymichael wants to merge 1 commit into
Open
Conversation
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.
Human comments
What was wrong
Electron Builder's maintained AppImage
AppRunprepends--no-sandboxwhen an unprivileged user namespace probe fails. The desktop re-enters its AppImage withELECTRON_RUN_AS_NODE=1to start the ownedbb-appbridge, so that Electron-only fallback became a Node option and Node exited with code 9 afterowned-runtime.jsonwas written but before readiness. User-namespace availability made the failure intermittent in CI. The startup error path rendered the buffered child output in the window but did not write it to stderr, so the package smoke reported only that the owned PID died and hid/tmp/.mount_*/bb: bad option: --no-sandbox.What changed
--end-of-options marker and anAppRun-visible--no-sandboxsentinel after the AppImage bridge bootstrap.AppRunnow leaves the invocation alone, Node treats the sentinel as data, and the bridge path remains in the owned process command.AppRunfixture that reproduces the fallback injection deterministically.There is no host-daemon wire change, so
HOST_DAEMON_PROTOCOL_VERSIONis unchanged. This does not change a timeout, retry, port, readiness assertion, process-ownership check, FUSE behavior, or GUI sandbox policy.How you verified
ab8e0a202c70525c3c935733300198dac617e3deforHEAD,origin/main, and merge-base before investigation.host_nwqfteeqz4, a current-main AppImage reproduced the exact smoke signature. The added logging exposed exit code 9 and/tmp/.mount_*/bb: bad option: --no-sandbox; the extracted generatedAppRunshowed the user-namespace-dependent fallback that injected it.pnpm exec turbo run test --filter=@bb/desktop --concurrency=2 -- --run test/bb-process.test.tsfailed the new fixture before the launch fix with/usr/bin/node: bad option: --no-sandbox(8 passed, 1 failed).pnpm exec turbo run desktop:build:linux --filter=@bb/desktop --concurrency=2passed (14/14 Turbo tasks).xvfb-run -a pnpm exec turbo run smoke:appimage-lifecycle --filter=@bb/desktop --force --concurrency=2passed against the rebuilt AppImage in 30.129s, including separate GUI-mount removal and healthy owned-runtime-mount assertions.pnpm exec turbo run typecheck --filter=@bb/desktop --concurrency=2passed (3/3 Turbo tasks).pnpm exec turbo run build --filter=@bb/desktop --concurrency=2passed (13/13 Turbo tasks).pnpm exec turbo run test --filter=@bb/desktop --concurrency=2reached 246 passing tests and 2 platform skips; the unrelated real-Electron preload smoke alone missed its existing fixed 15-second readiness ceiling on the Intel host. No timeout was changed or rerun used as evidence.pnpm exec oxfmt apps/desktop/src/bb-process.ts apps/desktop/src/main.ts apps/desktop/test/bb-process.test.ts --checkandgit diff --checkpassed.