Skip to content
Source
Sign inSign up
pingdotgg/t3code

Fix ChildProcess.spawn failing on Windows for .cmd shims #495

Mergedchuks-qua(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/495/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

What

Add shell: process.platform === "win32" to all ChildProcess.make calls that spawn tools installed as .cmd shims on Windows.

Why

On Windows, bun, npm, turbo, and bunx are installed as .cmd shell wrappers. Node's child_process.spawn cannot resolve .cmd extensions without shell: true, causing PlatformError: NotFound on fresh builds (no Turbo cache).

Key Changes

  • apps/server/scripts/cli.ts: Fix bun tsdown and npm publish spawns
  • scripts/dev-runner.ts: Fix turbo spawn (the actual entry point for bun run dev:desktop)
  • scripts/build-desktop-artifact.ts: Fix bun run build:desktop, bun install --production, and bunx electron-builder spawns

Follows the same shell: process.platform === "win32" pattern already used in codexAppServerManager.ts, processRunner.ts, open.ts, CodexTextGeneration.ts, and ProviderHealth.ts.

Closes #474

Note

Force Windows shell execution for ChildProcess.make in CLI build/publish and desktop build scripts to fix .cmd shim resolution failures

Add shell: process.platform === "win32" to ChildProcess.make calls in CLI handlers and desktop build scripts to run bun, npm, turbo, and electron-builder via the Windows shell for .cmd shim resolution. See apps/server/scripts/cli.ts, scripts/build-desktop-artifact.ts, and scripts/dev-runner.ts.

📍Where to Start

Start with the CLI command handlers in apps/server/scripts/cli.ts, focusing on the buildCmd and publishCmd ChildProcess.make options.

Macroscope summarized f18574b.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 2c37364b-a26f-46e3-b8e7-9d6b02c1eb48

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Post copyable unit tests in a comment

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. Can you leave a comment as to "why" we do this in the places where it is done? This is one of those things that will silently be forgotten about and break again otherwise

    3. @t3dotgg, added the comments

    4. t3dotgg(GitHub profile, opens in a new tab) approved these changes

Sign in to join this conversation.