Repository navigation
Windows: build and run natively - #33
Merged
Merged
Conversation
This was referenced Oct 30, 2026
endel
force-pushed
the
windows-support
branch
2 times, most recently
from
October 30, 2026 20:52
2b0adfa to
c845775
Compare
sys.zig was POSIX-only, with a compile error on every Windows branch. Windows now lives in sys/windows.zig: Winsock for sockets, std.Io for files, clocks, randomness and sleep. Callers go through new helpers instead of spelling out POSIX socket setup — udpSocket, setsockopt, setReuseAddr, stdout and argsIterator — which replaced setup code repeated across src and 26 apps. The event loop waits for readiness, which libxev's IOCP backend lacked, so build.zig.zon pins a libxev fork that adds poll through the AFD driver. On Windows a UDP socket no longer fails its next receive after an ICMP port-unreachable, SO_REUSEADDR is not set (it lets another socket take a port in use there), and ECN is neither read nor set. CI gains a Windows job. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YXLKbmpkRS5DedisNs9VNp Assisted-by: Claude Opus 5.5
endel
force-pushed
the
windows-support
branch
from
October 30, 2026 21:04
c845775 to
f46fee6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
quic-zig builds, tests and runs natively on Windows again, and CI gets back its
windows-latestjob. Rebased onto main (Zig 0.17), which added the HTTP/1.1 and WebSocket stack after this PR was first opened, so that is ported too.src/sys/windows.zig: Winsock for sockets,std.Iofor files and clocks. The per-function OS switches insrc/sys.zigbecame one supported-OS check.sys.udpSocket,tcpSocket,setsockopt,setReuseAddr,setReusePort,setDualStack,send,sendVec,shutdownandargsIteratorreplace socket setup and rawstd.ccalls acrosssrc/and the apps.xev_backend.PortWatchstands in forpollFdwhere a completion port has no fd to poll: a thread waits on the port, puts each packet back, and wakes the host.quic-zig-2026-10-30, which carries mitchellh/libxev#240 (readiness through AFD), #259 (run(.no_wait)never asked the completion port) and #260 (a shut-down socket panicked in safe builds).Also a fix on every platform:
onReadableonServerandClientrearmed a cancelled watch, so on a backend that hands a cancelled watch its error they never finished stopping on a shared loop.Windows behaviour worth knowing
In
SPEC/STATUS.md#platforms:SO_REUSEADDRisn't set, and a UDP socket no longer fails its next receive after an ICMP port-unreachable.SO_REUSEPORT:Http1Config.unix_pathandreuse_portreturn an error.sendcan take all of a large write, so backpressure shows a write later.sys.sleepNsunder a millisecond yields in a loop instead.Testing
zig build test1308 passed, 20 skipped;zig build fuzz908 passed, 3 skipped. This PR'swindows-latestjob is the first run on real Windows.zig build test1328/1328,zig build fuzz911/911.zig build test1323 passed, 5 skipped;zig build fuzz909 passed, 2 skipped.tests/e2e/run.shon this pin: macOS 475 passed, Linux 482 passed.The skipped Windows tests need a feature above, or POSIX behaviour such as
dup.🤖 Generated with Claude Code