Skip to content

fix(wasm): driver discovery on Windows hosts#399

Open
zeroshade wants to merge 1 commit into
mainfrom
fix/wasm-windows-loaddir
Open

fix(wasm): driver discovery on Windows hosts#399
zeroshade wants to merge 1 commit into
mainfrom
fix/wasm-windows-loaddir

Conversation

@zeroshade

@zeroshade zeroshade commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix listInstalled returning empty on Windows hosts when running via WASM. The root cause is Go's js/wasm syscall.Open rejecting O_DIRECTORY (Node.js doesn't expose fs.constants.O_DIRECTORY on Windows), which breaks os.ReadDir/os.DirFS/fs.Glob.
  • Split loadDir into build-tagged files: loaddir_js.go uses os.Open + File.ReadDir (avoids O_DIRECTORY); loaddir_other.go keeps the original os.DirFS + fs.Glob path.
  • Re-enable windows-latest in the WASM CI workflow.

Closes #396

Test plan

  • node packages/npm-wasm/test/smoke.cjs passes on Windows (install + listInstalled + uninstall round-trip)
  • node packages/npm-wasm/test/worker.test.cjs passes on Windows
  • go test ./config/... passes natively on Windows
  • go vet ./config/... passes for both GOOS=js and native targets
  • CI passes on all three platforms (ubuntu, macos, windows)

🤖 Generated with Claude Code

Under GOOS=js on Windows, os.ReadDir and os.DirFS fail because Go's
js/wasm syscall layer rejects O_DIRECTORY (Node.js doesn't expose
fs.constants.O_DIRECTORY on Windows). This caused listInstalled to
always return empty on Windows hosts.

Split loadDir into build-tagged files: the js variant uses os.Open
(no O_DIRECTORY) + File.ReadDir which works on all hosts. Re-enable
windows-latest in the WASM CI workflow.

Closes #396

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zeroshade zeroshade requested review from amoeba, ianmcook and kentkwu June 30, 2026 16:28
@zeroshade zeroshade added this to the 0.4.0 milestone Jun 30, 2026

@amoeba amoeba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems fine. The two variants share enough code that we could extract just the platform-variable part but this is simple and it works.

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.

WASM: complete Windows-host support for @columnar-tech/dbc-wasm

2 participants