fix(command): resolve fspy program paths#1868
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6ffc86c52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| S: AsRef<OsStr>, | ||
| { | ||
| let cwd = cwd.as_ref(); | ||
| let (program, prefix_args) = resolve_program(bin_name, envs, cwd)?; |
There was a problem hiding this comment.
Honor Windows Path overrides before resolving fspy programs
This newly added resolution step only consults envs.get("PATH") through resolve_program, but the create flow builds this fspy environment with prependToPathToEnvs, which preserves the existing path-key casing; on Windows that key is typically Path. When vp create relies on the downloaded package-manager binPrefix, resolving here searches the parent process PATH instead of the just-prepended Path, so it can fail to find pnpm/npx or run a global binary even though the child environment would contain the correct shim. Please resolve the PATH entry case-insensitively or normalize the env map before this call.
Useful? React with 👍 / 👎.
Summary
run_command_with_fspyresolve binaries through the sameresolve_programpath used byrun_command..cmd/PowerShell prefix handling before spawning through fspy.Closes #1599
Test Plan
git diff --checkRUSTUP_TOOLCHAIN=stable rustfmt --edition 2024 --check crates/vite_command/src/lib.rsAttempted but blocked locally:
RUSTUP_TOOLCHAIN=stable cargo test -p vite-command run_command_with_fspy -- --nocapturefailed during workspace dependency resolution because this workspace needs nightly-Z bindepsforfspyfromvite-task.nightly-2026-06-10) is partially installed locally andrustupstalled while downloading the required components.