Skip to content

fix(cli): resolve Windows shims in case-sensitive directories - #2727

Draft
fengmk2 wants to merge 5 commits into
mainfrom
codex/fix-windows-pnpm12-shims
Draft

fengmk2 wants to merge 5 commits into
mainfrom
codex/fix-windows-pnpm12-shims

Conversation

@fengmk2

@fengmk2 fengmk2 commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #2690.

On Windows, pnpm 12 writes lowercase .cmd shims. In a case-sensitive node_modules/.bin directory, PATHEXT=.COM;.EXE;.BAT;.CMD makes which check astro.CMD before correcting filename casing, so vp run fails to plan the task and vp exec astro reports that the command is missing.

Resolve Windows executable candidates using their actual filename casing in vp_command, preserving PATH and PATHEXT precedence. Use Vite+'s existing mutable command-handler hook to supply the resolved path before Vite Task's own lookup. This fixes nested tasks and direct execution entirely within Vite+, without dependency changes or PATHEXT mutation.

The Windows snapshot job sets SystemTemp to an isolated directory on the runner's NTFS workspace volume, outside runner.temp so Yarn does not inherit setup-node's .npmrc. Rust uses GetTempPath2, which ignores the existing TEMP/TMP overrides under SYSTEM; the runner's default C:\Windows\SystemTemp rejects case-sensitive directory flags, while its workspace volume supports them.

Validation

  • CI passed on commit 999f317b, including all three Windows snapshot shards and both case-sensitive shim entrypoints.

  • Reproduced the failure with published Vite+ 0.3.2, pnpm 12.4.1, and Astro 7.3.2 in a case-sensitive Windows directory. With the compiled fix, the unchanged nested task and vp exec both run Astro successfully.

  • cargo test -p vp_command -p vite-plus-cli --lib --locked: 91 tests passed, including 10 new resolver/handler tests.

  • Focused Clippy for both crates, all targets and the rolldown feature, passed with warnings denied and the repository's existing upstream lint allowances.

  • Built the native CLI with the rolldown feature, the global CLI, and the Windows trampoline.

  • New CLI snapshots passed in record and compare modes for both local and global entrypoints. They create a genuinely case-sensitive .bin directory and cover nested planning, direct exec, a later uppercase shim, and cache replay.

  • Rust formatting and git diff --check passed.

Local validation ran on Windows ARM64 with Node 24.20.0. CLI integration used the branch's compiled Rust binaries with the published 0.3.2 JavaScript artifacts; a full pnpm build and the full repository test suite were not run.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 16, 2026

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://codex-fix-windows-pnpm12-shims-viteplus-dev.voidzero-docs.workers.dev (commit 201da27)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://bc2e3509-viteplus-dev.voidzero-docs.workers.dev 201da27 2026-09-16T17:56:05.932Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://34cd7f6e-viteplus-dev.voidzero-docs.workers.dev 999f317 2026-09-16T17:38:12.712Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://b2e2cb81-viteplus-dev.voidzero-docs.workers.dev b869450 2026-09-16T17:22:02.905Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://dd435de3-viteplus-dev.voidzero-docs.workers.dev a52fe84 2026-09-16T16:54:58.959Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://77866e45-viteplus-dev.voidzero-docs.workers.dev c124cf5 2026-09-16T16:24:07.710Z Visit the dashboard ↗

@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

CLI artifact sizes (201da27)

Final release artifacts built by the canonical build-upstream and build-windows-cli actions.
The dist rows use the Linux build. The core total excludes .node files to match the release artifact.

Artifact Format Base PR Change
packages/cli/dist Directory total 2.15 MiB 2.15 MiB 0 B (0.00%)
packages/core/dist Directory total 3.95 MiB 3.95 MiB 0 B (0.00%)
Combined package dist Directory total 6.09 MiB 6.09 MiB 0 B (0.00%)
vp (Linux x64) Binary 11.18 MiB 11.18 MiB 0 B (0.00%)
vp (Linux x64) gzip -9 4.84 MiB 4.84 MiB -1 B (-0.00%)
NAPI (Linux x64) Binary 32.01 MiB 32.01 MiB 0 B (0.00%)
NAPI (Linux x64) gzip -9 12.69 MiB 12.69 MiB -2 B (-0.00%)
vp (macOS ARM64) Binary 8.33 MiB 8.33 MiB 0 B (0.00%)
vp (macOS ARM64) gzip -9 4.22 MiB 4.22 MiB -6 B (-0.00%)
NAPI (macOS ARM64) Binary 39.64 MiB 39.64 MiB 0 B (0.00%)
NAPI (macOS ARM64) gzip -9 17.01 MiB 17.01 MiB +1 B (+0.00%)
vp (Windows x64) Binary 9.06 MiB 9.04 MiB -26.50 KiB (-0.29%)
vp (Windows x64) gzip -9 3.96 MiB 3.95 MiB -11.51 KiB (-0.28%)
NAPI (Windows x64) Binary 26.98 MiB 26.95 MiB -26.00 KiB (-0.09%)
NAPI (Windows x64) gzip -9 10.80 MiB 10.79 MiB -14.65 KiB (-0.13%)
Trampoline (Windows x64) Binary 13.50 KiB 13.50 KiB 0 B (0.00%)
Trampoline (Windows x64) gzip -9 7.03 KiB 7.03 KiB 0 B (0.00%)
Installer (Windows x64) Binary 4.53 MiB 4.53 MiB 0 B (0.00%)
Installer (Windows x64) gzip -9 2.12 MiB 2.12 MiB +2 B (+0.00%)

@fengmk2
fengmk2 force-pushed the codex/fix-windows-pnpm12-shims branch from 999f317 to 4ef9e6b Compare September 16, 2026 17:51
@fengmk2
fengmk2 force-pushed the codex/fix-windows-pnpm12-shims branch from 4ef9e6b to 201da27 Compare September 16, 2026 17:54
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.

vp run fails to resolve node_modules/.bin executables with pnpm 12 on Windows (cannot find binary path)

1 participant