Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the tracked P0 (note/p0-windows-shim-bin-path.md): on Windows,
node/npm/npxvia PATH were broken in Full Shim mode — every dispatch throughshims\*.cmdfailed withnvm: node not found.Root cause (empirically reproduced in a controlled layout, 100% repro):
version_bin_dir()returns the root for exactly this reason):resolveonly checked%NVM_DIR%\%CURRENT%\bin\— a directory that never exists on Windowsshims;active;bin, so the broken dispatcher always won resolution before the workingactivejunctionNVM_DIR=%USERPROFILE%\.nvm.rustunconditionally, clobbering customNVM_DIRFix
:resolvenow checks the version dir root first (.exethen.cmd), keepingbin\as fallback — applied to both copies of the script (src/shim.rs+install.ps1)if not defined NVM_DIR set ...set "BIN=..."in install.ps1 (spaces in paths)Tests
src/shim.rs: root-before-bin ordering + NVM_DIR guard content teststests/win_shim_dispatch.rs: install.ps1 content assertions + a Windows end-to-end test — realnvm refreshgenerates the shims against a root-layout fake version dir, then dispatchingshims\node.cmd --versionmust succeed (this exact scenario failed before the fix)Test plan
cargo fmt --check/clippy -D warnings/cargo test --allgreen locally (18 groups)