Skip to content

fix: support native windows development - #5895

Open
octopols wants to merge 11 commits into
rivet-dev:mainfrom
octopols:octopols/windows-native-dev
Open

octopols wants to merge 11 commits into
rivet-dev:mainfrom
octopols:octopols/windows-native-dev

Conversation

@octopols

Copy link
Copy Markdown

Building rivet natively on windows (no wsl) didnt work at all, this fixes the stuff that was broken so you can build and run the engine + rivetkit on windows

what was broken:

  • bare-ts codegen in the protocol build.rs files ran cli.js directly, windows ignores the shebang so engine build failed. now runs through node
  • rivetkit-napi build script couldnt launch the napi cli (its a .cmd on windows), now runs it through node
  • pre-commit formatter couldnt launch biome on windows so every commit touching ts/js got blocked, also generated file detection broke cause of backslash paths
  • tests looked for target/debug/rivet-engine without .exe so on windows they silently used the npm engine instead
  • engine crashed on startup with stack overflow, windows main thread only gets 1mb vs 8mb on linux. added /STACK for windows msvc in .cargo/config.toml
  • engine listens on [::] which is ipv6 only by default on windows so 127.0.0.1 got refused. added a small dual-stack bind helper in rivet-util used by guard, api-peer and metrics
  • the actor_runtime_socket.unsupported.json artifact only gets compiled on non-unix so windows builds kept rewriting it, committed the generated version
  • added docs-internal/WINDOWS_DEVELOPMENT.md with the setup steps

tested:

  • followed the new guide from a fresh clone on windows 11, engine + rivetkit + native addon build fine
  • engine /health works on 127.0.0.1 and [::1]
  • hello-world example works end to end, http actions, websocket events and state all good
  • added tests for the dual-stack bind, fails without the fix and passes with it
  • applied the same commits on linux (ubuntu 24.04), engine build, codegen output is byte identical, net tests, health on ipv4/ipv6, formatter, napi build and a driver test all pass
  • pre-commit hooks pass on both

shouldnt affect anything else:

  • linux and mac behave the same, sockets were already dual stack there and the stack flag only applies to windows msvc
  • the mingw cross compile for windows releases isnt touched (cfg is msvc only and that build sets its own RUSTFLAGS)
  • one edge case: if someone set net.ipv6.bindv6only=1 on linux the engine will still accept ipv4 on [::] now

not tested:

  • macos, didnt setup dev env there
  • wasm runtime build on windows
  • full driver test suite natively on windows

Related: #5619

@octopols
octopols force-pushed the octopols/windows-native-dev branch 2 times, most recently from a1a9462 to ce22418 Compare October 20, 2026 08:01
@octopols
octopols force-pushed the octopols/windows-native-dev branch from ce22418 to fdd53fb Compare October 20, 2026 17:02

This branch has not been deployed

No deployments
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.

1 participant