Skip to content

fix: resolve Windows host build and test compatibility issues - #374

Open
SidakSethi-Singh wants to merge 1 commit into
truefoundry:mainfrom
SidakSethi-Singh:fix/windows-build-compatibility
Open

fix: resolve Windows host build and test compatibility issues#374
SidakSethi-Singh wants to merge 1 commit into
truefoundry:mainfrom
SidakSethi-Singh:fix/windows-build-compatibility

Conversation

@SidakSethi-Singh

@SidakSethi-Singh SidakSethi-Singh commented Aug 20, 2026

Copy link
Copy Markdown

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.

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fd79940

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@truefoundry/trueforge-ui Patch
@truefoundry/trueforge Patch
@truefoundry/trueforge-core Patch
frontend Patch

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ 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',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Triggered by project rule: TrueForge review rules

Reviewed by Cursor Bugbot for commit fd79940. Configure here.

@chiragjn

Copy link
Copy Markdown
Member

Thank you for contributing and helping improve support on Windows, please give us some to review and get back.

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.

2 participants