2.8 KiB
Executable File
2.8 KiB
Executable File
| title | summary |
|---|---|
| Windows & WSL tips | What to do when pnpm/test flows fail on NTFS-backed worktrees. |
Installing dependencies
pnpm installfails on/mnt/cbecause NTFS/DrvFs blocksfutime. Clone/sync the repo to$HOME(ext4 inside WSL) and run./runner pnpm installthere instead. Example:rsync -a --delete --exclude node_modules /mnt/c/Projects/mcporter/ ~/mcporter-wsl/.- Keep
$HOME/.bun/binand$HOME/.local/share/pnpmon your PATH before invoking./runner. Without Bun and pnpm the runner prints the guardrail error and exits. - If you must work from
/mnt/c, remount withmetadatasupport (sudo mount -t drvfs C: /mnt/c -o metadata,uid=$(id -u),gid=$(id -g),umask=22,fmask=111). Otherwise installs, chmods, and copyfile calls will continue to fail.
Running tests
- Use the ext4 copy (
~/mcporter-wsl) forpnpm lint,pnpm typecheck, and the Vitest suites. All tests pass there (71 files / 280 tests, 1 file and 2 tests skipped). - Whole-repo
pnpm teston/mnt/crepeatedly times out because Vitest cannot start workers when the node_modules tree belongs to root or sits on NTFS. Copy the repo to ext4 or fix ownership before retrying. - When working cross-filesystem, remember to sync the edited source files back to the canonical
/mnt/c/Projects/mcportertree (e.g.,rsync -a ~/mcporter-wsl/src/cli/generate/{template,artifacts,fs-helpers}.ts /mnt/c/Projects/mcporter/src/cli/generate/). - The stdio integration suite now vendors two tiny fixtures under
tests/fixtures/stdio-*.mjsthat spin up filesystem/memory MCP servers vianode. The tests shell out toprocess.execPath, so make sure your PATH resolvesnodecorrectly (fnm/nvs setups sometimes expose onlynode.exeon Windows). If you need to debug them manually, run./runner pnpm exec vitest run tests/stdio-servers.integration.test.tsso the guardrails apply.
Windows-specific fixes in the repo
- CLI generation now uses
src/cli/generate/fs-helpers.ts:markExecutableignoresEPERM/EINVAL/ENOSYS/EACCESso NTFS builds no longer fail when setting executable bits. safeCopyFilefalls back to a manual read/write when DrvFs blockscopyFile, keeping Bun bundling stable on Windows.- These helpers only affect Windows/WSL behavior—Linux/macOS paths still perform real
chmod/copyFile. - Regenerated CLIs (for example
node dist/cli.js generate-cli context7 --config config/mcporter.json --bundle /mnt/c/Temp/context7-cli.js --runtime node) now complete successfully even when the bundle lives on/mnt/c, and the resulting executable runs withnode /mnt/c/Temp/context7-cli.js --help. - When running
mcporter generate-cliwith--command ./relative-script.ts, the CLI no longer tries to normalize the path into an HTTP URL—relative/bare commands are always treated as STDIO transports now, matching the PowerShell/WSL behavior you expect.