From 4fd91e6ea9ea04115f4d48d2aec5d9b338aeaee6 Mon Sep 17 00:00:00 2001 From: Chukwudi Nwobodo Date: Sun, 8 Mar 2026 05:58:44 +0000 Subject: [PATCH 1/3] fix(scripts): enable shell mode on Windows for .cmd shim resolution On Windows, tools like `bun`, `npm`, `turbo`, and `bunx` are installed as `.cmd` shims. Node's `child_process.spawn` cannot resolve these without `shell: true`, causing `PlatformError: NotFound` on fresh builds where there is no Turbo cache. Add `shell: process.platform === "win32"` to all ChildProcess.make calls in cli.ts, dev-runner.ts, and build-desktop-artifact.ts. Closes #474 --- scripts/build-desktop-artifact.ts | 3 +++ scripts/dev-runner.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/scripts/build-desktop-artifact.ts b/scripts/build-desktop-artifact.ts index 8823b88513..810cff0b06 100644 --- a/scripts/build-desktop-artifact.ts +++ b/scripts/build-desktop-artifact.ts @@ -580,6 +580,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* ( ChildProcess.make({ cwd: repoRoot, ...commandOutputOptions(options.verbose), + shell: process.platform === "win32", })`bun run build:desktop`, ); } @@ -642,6 +643,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* ( ChildProcess.make({ cwd: stageAppDir, ...commandOutputOptions(options.verbose), + shell: process.platform === "win32", })`bun install --production`, ); @@ -680,6 +682,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* ( cwd: stageAppDir, env: buildEnv, ...commandOutputOptions(options.verbose), + shell: process.platform === "win32", })`bunx electron-builder ${platformConfig.cliFlag} --${options.arch} --publish never`, ); diff --git a/scripts/dev-runner.ts b/scripts/dev-runner.ts index c72411e318..5ab3102284 100644 --- a/scripts/dev-runner.ts +++ b/scripts/dev-runner.ts @@ -455,6 +455,7 @@ export function runDevRunnerWithInput(input: DevRunnerCliInput) { stderr: "inherit", env, extendEnv: false, + shell: process.platform === "win32", // Keep turbo in the same process group so terminal signals (Ctrl+C) // reach it directly. Effect defaults to detached: true on non-Windows, // which would put turbo in a new group and require manual forwarding. From ba68eefd05ce293178e8864bf551e5dcf8f76b28 Mon Sep 17 00:00:00 2001 From: Chukwudi Nwobodo Date: Mon, 9 Mar 2026 00:52:18 +0000 Subject: [PATCH 2/3] docs: add comments explaining Windows shell spawn requirement --- apps/server/scripts/cli.ts | 1 + scripts/build-desktop-artifact.ts | 1 + scripts/dev-runner.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/apps/server/scripts/cli.ts b/apps/server/scripts/cli.ts index e5b5c0d00a..8456a0a25d 100644 --- a/apps/server/scripts/cli.ts +++ b/apps/server/scripts/cli.ts @@ -132,6 +132,7 @@ const buildCmd = Command.make( cwd: serverDir, stdout: config.verbose ? "inherit" : "ignore", stderr: "inherit", + // Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd). shell: process.platform === "win32", })`bun tsdown`, ); diff --git a/scripts/build-desktop-artifact.ts b/scripts/build-desktop-artifact.ts index 810cff0b06..db9f985e73 100644 --- a/scripts/build-desktop-artifact.ts +++ b/scripts/build-desktop-artifact.ts @@ -580,6 +580,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* ( ChildProcess.make({ cwd: repoRoot, ...commandOutputOptions(options.verbose), + // Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd). shell: process.platform === "win32", })`bun run build:desktop`, ); diff --git a/scripts/dev-runner.ts b/scripts/dev-runner.ts index 5ab3102284..89d7a104cf 100644 --- a/scripts/dev-runner.ts +++ b/scripts/dev-runner.ts @@ -455,6 +455,7 @@ export function runDevRunnerWithInput(input: DevRunnerCliInput) { stderr: "inherit", env, extendEnv: false, + // Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd). shell: process.platform === "win32", // Keep turbo in the same process group so terminal signals (Ctrl+C) // reach it directly. Effect defaults to detached: true on non-Windows, From f18574b072353e604613ae1458b7cdd7bc687206 Mon Sep 17 00:00:00 2001 From: Chukwudi Nwobodo Date: Mon, 9 Mar 2026 00:53:46 +0000 Subject: [PATCH 3/3] docs: add shell spawn comments to remaining call sites --- apps/server/scripts/cli.ts | 1 + scripts/build-desktop-artifact.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/apps/server/scripts/cli.ts b/apps/server/scripts/cli.ts index 8456a0a25d..3eaa72ea8e 100644 --- a/apps/server/scripts/cli.ts +++ b/apps/server/scripts/cli.ts @@ -227,6 +227,7 @@ const publishCmd = Command.make( cwd: serverDir, stdout: config.verbose ? "inherit" : "ignore", stderr: "inherit", + // Windows needs shell mode to resolve .cmd shims. shell: process.platform === "win32", }), ); diff --git a/scripts/build-desktop-artifact.ts b/scripts/build-desktop-artifact.ts index db9f985e73..c44109faea 100644 --- a/scripts/build-desktop-artifact.ts +++ b/scripts/build-desktop-artifact.ts @@ -644,6 +644,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* ( ChildProcess.make({ cwd: stageAppDir, ...commandOutputOptions(options.verbose), + // Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd). shell: process.platform === "win32", })`bun install --production`, ); @@ -683,6 +684,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* ( cwd: stageAppDir, env: buildEnv, ...commandOutputOptions(options.verbose), + // Windows needs shell mode to resolve .cmd shims. shell: process.platform === "win32", })`bunx electron-builder ${platformConfig.cliFlag} --${options.arch} --publish never`, );