Fix nested pnpm spawns on Windows - #235
Conversation
Preview:
|
|
I've completed a thorough review. The PR is a clean, well-documented, well-tested refactor. Let me summarize. ReviewThis is a high-quality, focused change. I found no actionable issues. What it does, and why it's correct:
Testing: The new tests cover the meaningful cases — Non-blocking observations (not part of this PR's scope, no change requested):
LGTM! |
707b746 to
73a5e4e
Compare
|
The review is complete. All files examined, tests run (14/14 pass), and I've verified the correctness of the design decisions. ReviewThis is a clean, focused, well-tested refactor that fixes a real Windows blocker (#19, #120). I found no actionable issues. What it does, and why it's correct:
Testing: New tests cover the meaningful cases — One design point worth noting (not a defect): the bare- LGTM! |
73a5e4e to
2f93df9
Compare
|
Behavior parity confirmed. The change from My review is complete. I've examined all 11 changed files, verified the This is a clean, well-scoped, well-documented refactor that fixes a genuine Windows blocker (#19, #120). The design is sound:
I found no actionable issues. The prior review's design notes (bare- LGTM! |
2f93df9 to
0e64c1b
Compare
|
No CRLF-tracked files, so I've reviewed all 11 changed files. My analysis:
Ran the three affected test files: 14/14 pass. No remaining direct I found no actionable issues. LGTM! |
0e64c1b to
c7ffc45
Compare
c7ffc45 to
c6a0f00
Compare
|
@Maximo-Guk Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
Preview:
|
|
bonk break glass |
On Windows the `pnpm` on PATH is a `.cmd` shim. Node spawns processes directly rather than through a shell, so there is no extensionless `pnpm` to execute (ENOENT), and naming the shim explicitly fails too since the CVE-2024-27980 fix (EINVAL). `shell: true` is not a fix here: a shell re-splits the command line, and these callers pass absolute paths built from the checkout location, which break apart on a path containing a space. Add scripts/pnpm-command.ts, which runs pnpm's own JS entry point under `node` when `npm_execpath` points at it, so argv survives byte-for-byte with no shell. Guarded on the path, because under `npm run` that variable points at npm and substituting it unchecked would run npm against a pnpm workspace. Where pnpm is a native executable the plain `pnpm` fallback still resolves it, since PATH lookup appends `.exe` but not `.cmd`. That alone is not enough for the `pnpm exec` sites: Vite+ runs task commands with a filtered environment that omits `npm_execpath`, so build-app.mjs has no way back to pnpm at all. Extract the existing resolveBinEntry() out of run-dev-server.ts into scripts/bin-entry.ts and reach those binaries directly, which also skips ~0.33s of pnpm startup per call. Verified on Windows 11 / Node 24.19.0 / pnpm 11.17.0: `pnpm run-local` goes from failing at the first `pnpm install` to serving HTTP 200 on 8787. Fixes #19 Fixes #120 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
c6a0f00 to
826e991
Compare
Fixes #19, fixes #120. Supersedes #107 by @Sainigurnoor511, whose
npm_execpathapproach this builds on. Stacked on #233.pnpm run-localandpnpm dev-servercannot start on Windows:pnpmon PATH is a.cmdshim, which Node cannot spawn without a shellChanged it so that the
pnpm execsites now resolve their binary directly, only falling back to pnpm if the binary is not found. We were actually already using this approach for therun-dev-serverfile to reduce overhead from invoking pnpm ( ~0.33 s of overhead compared to invoking node binary directly ).Verified on my Windows 11 VM.