diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3996eec0e7..a24b8efb06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,7 @@ jobs: - name: Desktop perf trace test if: github.event_name != 'pull_request' env: + ELECTRON_DISABLE_SANDBOX: "1" T3CODE_PERF_TIMEOUT_MS: "420000" T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5" T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000" @@ -85,6 +86,7 @@ jobs: - name: Desktop perf trace test (fork PR) if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository env: + ELECTRON_DISABLE_SANDBOX: "1" T3CODE_PERF_TIMEOUT_MS: "420000" T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5" T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000" @@ -94,6 +96,7 @@ jobs: if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository env: GH_TOKEN: ${{ github.token }} + ELECTRON_DISABLE_SANDBOX: "1" T3CODE_PERF_TIMEOUT_MS: "420000" T3CODE_PERF_MAX_LONG_DISPATCH_COUNT: "5" T3CODE_ELECTRON_STARTUP_TIMEOUT_MS: "180000" diff --git a/apps/desktop/scripts/dev-electron.mjs b/apps/desktop/scripts/dev-electron.mjs index c4a85de1ce..5e513e431e 100644 --- a/apps/desktop/scripts/dev-electron.mjs +++ b/apps/desktop/scripts/dev-electron.mjs @@ -107,6 +107,11 @@ const command = process.platform === "win32" ? "electronmon.cmd" : "electronmon" const childEnv = { ...process.env }; delete childEnv.ELECTRON_RUN_AS_NODE; +if (process.platform === "linux" && !childEnv.ELECTRON_DISABLE_SANDBOX) { + childEnv.ELECTRON_DISABLE_SANDBOX = "1"; + console.log("[dev-electron] enabling ELECTRON_DISABLE_SANDBOX=1 on Linux"); +} + const child = spawn(command, ["dist-electron/main.js"], { stdio: "inherit", env: { diff --git a/scripts/desktop-perf-trace.mjs b/scripts/desktop-perf-trace.mjs index 36cb647f91..4cd183c4d8 100644 --- a/scripts/desktop-perf-trace.mjs +++ b/scripts/desktop-perf-trace.mjs @@ -351,6 +351,9 @@ function inferDesktopPerfTimeoutHint(logChunks) { if (lowered.includes("error while loading shared libraries")) { return "Electron failed to start due missing Linux shared libraries."; } + if (lowered.includes("setuid_sandbox_host.cc") || lowered.includes("chrome-sandbox")) { + return "Electron sandbox setup failed on Linux CI (setuid sandbox helper)."; + } if (lowered.includes("no usable sandbox")) { return "Electron sandbox failed to initialize in CI."; } diff --git a/turbo.json b/turbo.json index a3ed668b21..e7f9edb962 100644 --- a/turbo.json +++ b/turbo.json @@ -5,6 +5,7 @@ "VITE_WS_URL", "VITE_DEV_SERVER_URL", "ELECTRON_RENDERER_PORT", + "ELECTRON_DISABLE_SANDBOX", "T3CODE_LOG_WS_EVENTS", "T3CODE_MODE", "T3CODE_PORT",