Skip to content

ci(turbo): pass PATHEXT and ComSpec through on Windows so the pnpm shim finds pnpm.exe - #244

Open
BSalaeddin wants to merge 1 commit into
mainfrom
ci/turbo-windows-env-passthrough
Open

BSalaeddin wants to merge 1 commit into
mainfrom
ci/turbo-windows-env-passthrough

Conversation

@BSalaeddin

Copy link
Copy Markdown
Collaborator

Turbo runs tasks under strict env mode by default, which strips every variable a task does not declare. On Windows that includes PATHEXT and ComSpec, and stripping PATHEXT breaks every task turbo runs here: the pnpm on PATH is a shim that re-executes the engine pinned by packageManager, and without PATHEXT it looks for an extensionless pnpm, never considers pnpm.exe, and exits with ERR_PNPM_ENGINE_BIN_MISSING. Upstream fixed this in vercel/turborepo#13114 by adding both variables to turbo's default passthrough list, shipped in turbo v2.10.0. This repo is on turbo 2.5.4, so the passthrough is declared in turbo.json instead.

Proof on the affected machine, in a clean worktree of this branch, with no --env-mode=loose:

# before (this commit reverted)
pnpm exec turbo run lint --force
 Tasks:    0 successful, 2 total
 Failed:   caramel-extension#lint

# after
pnpm exec turbo run lint --force
 Tasks:    2 successful, 2 total

This adds globalPassThroughEnv only and declares no build-time variables, so the Dockerfile rule documented in CLAUDE.md is untouched: the image build stays pnpm --filter caramel-app run build, never turbo run build.

No-op on Linux CI: neither variable exists on the runners, and passing through an unset variable changes nothing.

🤖 Generated with Claude Code

…im finds pnpm.exe

Turbo's default strict env mode strips PATHEXT and ComSpec from task
environments. On Windows that breaks every task turbo runs: the `pnpm` on
PATH is a shim that re-executes the engine pinned by `packageManager`, and
with no PATHEXT it looks for an extensionless `pnpm`, never considers
`pnpm.exe`, and dies with ERR_PNPM_ENGINE_BIN_MISSING. Upstream fixed this
in vercel/turborepo#13114 by adding both variables to turbo's default
passthrough list, released in turbo v2.10.0; this repo is on turbo 2.5.4,
so the passthrough is declared here instead.

Proven on the affected machine: `turbo run lint --force` without
--env-mode=loose goes from 0 of 2 tasks succeeding to 2 of 2.

This is globalPassThroughEnv only — it declares no build-time variables, so
the Dockerfile rule stands unchanged: the image build stays
`pnpm --filter caramel-app run build`, never `turbo run build`.

No-op on Linux CI: neither variable exists there, and passing through an
unset variable changes nothing.
@BSalaeddin
BSalaeddin force-pushed the ci/turbo-windows-env-passthrough branch from fbd5d9a to 4ef0cdb Compare September 15, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant