fix: resolve Windows host build and test compatibility issues - #374
fix: resolve Windows host build and test compatibility issues#374SidakSethi-Singh wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: fd79940 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fd79940. Configure here.
| execFileSync(process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm', ['pack', '--pack-destination', tempDir], { | ||
| cwd: packageRoot, | ||
| stdio: 'inherit', | ||
| shell: process.platform === 'win32', |
There was a problem hiding this comment.
Smoke pack breaks on spaced paths
Medium Severity
On Windows, execFileSync now runs with shell: true, which concatenates argv with spaces and does not quote them. tempDir often contains spaces (for example under C:\Users\First Last\...), so --pack-destination splits and pnpm pack fails. Without shell: true, those arguments stayed intact as separate argv entries.
Reviewed by Cursor Bugbot for commit fd79940. Configure here.
| "check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", | ||
| "check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", | ||
| "build": "pnpm build:cjs && pnpm build:esm", | ||
| "build": "node -e \"const fs = require('fs'); fs.rmSync('dist', { recursive: true, force: true })\" && pnpm build:cjs && pnpm build:esm", |
There was a problem hiding this comment.
Hand-edited generated SDK package
Medium Severity
The SDK build script was edited by hand in packages/trueforge-sdk. That tree is regenerated by Fern in CI, so this cross-platform fs.rmSync clean step will be overwritten on the next SDK generate unless it lives in generator config or .fernignore.
Triggered by project rule: TrueForge review rules
Reviewed by Cursor Bugbot for commit fd79940. Configure here.
|
Thank you for contributing and helping improve support on Windows, please give us some to review and get back. |


Summary
This PR resolves compatibility issues when building, linting, and running the test suite on Windows hosts.
Changes made
Clean scripts — replaced Unix-specific rm -rf build-clean commands with a cross-platform node -e "fs.rmSync(...)" equivalent.
Environment variables — updated inline env var syntax in package scripts (via cross-env) so they work in both Windows Command Prompt/PowerShell and Unix shells.
Sandbox paths — updated layout path handling in Sandbox.ts to use node:path/posix instead of node:path, since the sandbox runtime is POSIX-based regardless of host OS and needs consistent forward-slash paths.
Smoke test / platform checks — updated packageExports.smoke.mjs to run correctly under pnpm.cmd on Windows.
UDS transport — CodeModeUdsTransport.ts skips owner-only permission checks and Unix socket path-length validation on Windows, since Windows named pipes don't have the same constraints as Unix domain sockets, and uses Windows junctions for temp test directories instead of symlinks.
Verification
npx pnpm build compiles successfully
npx pnpm lint:ci passes without errors
npx pnpm test — all 374 unit tests pass
npx pnpm test:store:sqlite — all 56 tests pass
All changes were tested locally on a Windows host.