mirror of
https://github.com/anywhere-labs/dsh-desktop.git
synced 2026-09-28 05:03:17 +08:00
The upstream runner only set ELECTRON_RUN_AS_NODE on its Windows path, so a Linux Electron host spawned tool runners as full applications that died inside their launch scope — bash, glob, and grep all failed in packaged sessions. A yarn patch: resolution applies the flag for every Electron host at exactly the runner-child environment, replacing the earlier whole-process export (which would have turned every Chromium child — renderer, GPU, network service — into a dying Node process). The packaging chain carries the patched package into both artifacts; packaged-runtime and package-surface tests are updated to pin it.
19 lines
840 B
Diff
19 lines
840 B
Diff
diff --git a/lib/runner-launch-COYGu0Dl.js b/lib/runner-launch-COYGu0Dl.js
|
|
--- a/lib/runner-launch-COYGu0Dl.js
|
|
+++ b/lib/runner-launch-COYGu0Dl.js
|
|
@@ -1449,6 +1449,14 @@
|
|
const normalized = name.toUpperCase();
|
|
if (RUNNER_CONTROL_ENV_PREFIXES.some((prefix) => normalized.startsWith(prefix))) Reflect.deleteProperty(env, name);
|
|
}
|
|
+ // Electron hosts must start the private runner in Node mode on every
|
|
+ // platform; target env arrives over IPC, so never add this flag to it.
|
|
+ if (process.versions.electron !== void 0 && (process.platform !== "win32" || selection === WINDOWS_RUNNER_SELECTION)) {
|
|
+ for (const name of Object.keys(env)) {
|
|
+ if (name.toUpperCase() === "ELECTRON_RUN_AS_NODE") Reflect.deleteProperty(env, name);
|
|
+ }
|
|
+ env.ELECTRON_RUN_AS_NODE = "1";
|
|
+ }
|
|
return {
|
|
...env,
|
|
[SUBPROCESS_RUNNER_ENV]: selection,
|