Skip to content

fix: preserve PATHEXT for Windows cached tasks#366

Merged
branchseer merged 2 commits intovoidzero-dev:mainfrom
SegaraRai:fix-365-upstream
Apr 30, 2026
Merged

fix: preserve PATHEXT for Windows cached tasks#366
branchseer merged 2 commits intovoidzero-dev:mainfrom
SegaraRai:fix-365-upstream

Conversation

@SegaraRai
Copy link
Copy Markdown
Contributor

@SegaraRai SegaraRai commented Apr 28, 2026

Fixes #365.

Preserves PATHEXT in the default Windows environment passthrough so PowerShell package shims can resolve node.exe during cached task execution.

Why PATHEXT is required

In the issue repro, marker-cli is exposed through a pnpm-generated node_modules/.bin/marker-cli.ps1 shim. On Windows, that shim sets $exe = ".exe" and then falls back to invoking Node by name:

& "node$exe" "$basedir/../marker-cli/bin/marker-cli.mjs" $args

So the actual command is & "node.exe" ....

When PATHEXT is missing from the sanitized cached-task environment, PowerShell can still locate node.exe with Get-Command node.exe, but native invocation by name does not run correctly: & "node.exe" --version produces no output, $LASTEXITCODE is unset, and the repro marker file is not created. Restoring PATHEXT with .EXE makes the same shim execute normally and create the marker.

This is why preserving PATHEXT fixes the cached PowerShell shim path without changing fspy or the shim rewrite itself.

Verified with the issue repro on Windows, cargo fmt --check, cargo build -p vite_task_bin, and cargo test -p vite_task_plan --test plan_snapshots -- windows_cmd_shim_rewrite.

@SegaraRai SegaraRai marked this pull request as draft April 28, 2026 12:11
@SegaraRai SegaraRai force-pushed the fix-365-upstream branch 2 times, most recently from 77b9c71 to 1e39e4b Compare April 28, 2026 12:23
@SegaraRai SegaraRai marked this pull request as ready for review April 28, 2026 12:29
@fengmk2 fengmk2 requested a review from branchseer April 29, 2026 11:06
@branchseer branchseer merged commit 7f81c7a into voidzero-dev:main Apr 30, 2026
12 checks passed
@branchseer
Copy link
Copy Markdown
Member

Thanks!

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.

Windows cached tasks can skip Node CLI execution through PowerShell package shims

3 participants