relay.dial resolves hostnames through libc getaddrinfo (src/relay.zig), which Zig 0.16 does not declare for Windows. Any Windows build of a dependent fails to compile:
error: root source file struct 'os.windows.ws2_32' has no member named 'addrinfo'
Reproduce with a cross-compile from any host:
zig build -Dtarget=x86_64-windows
Found by adding Linux and Windows builds to a dependent's CI. Linux builds and tests the whole stack cleanly; only Windows is affected.
Background
The direct getaddrinfo call was deliberate: it fixed dials hanging forever on macOS, where /etc/resolv.conf is empty and the standard library's own resolver fell back to a dead nameserver. That reasoning still holds for POSIX, so the fix is to keep this path there and give Windows its own.
Options
- Select the resolver at comptime: keep
getaddrinfo on POSIX and use std.net's resolver (or GetAddrInfoW via ws2_32) on Windows.
- Declare the missing
addrinfo bindings for Windows locally rather than relying on std.c.
The first keeps the macOS fix intact and confines the platform difference to one function.
No urgency from my side: Windows is a later target, and its CI job is reporting rather than blocking until this lands.
relay.dialresolves hostnames through libcgetaddrinfo(src/relay.zig), which Zig 0.16 does not declare for Windows. Any Windows build of a dependent fails to compile:Reproduce with a cross-compile from any host:
Found by adding Linux and Windows builds to a dependent's CI. Linux builds and tests the whole stack cleanly; only Windows is affected.
Background
The direct
getaddrinfocall was deliberate: it fixed dials hanging forever on macOS, where/etc/resolv.confis empty and the standard library's own resolver fell back to a dead nameserver. That reasoning still holds for POSIX, so the fix is to keep this path there and give Windows its own.Options
getaddrinfoon POSIX and usestd.net's resolver (orGetAddrInfoWviaws2_32) on Windows.addrinfobindings for Windows locally rather than relying onstd.c.The first keeps the macOS fix intact and confines the platform difference to one function.
No urgency from my side: Windows is a later target, and its CI job is reporting rather than blocking until this lands.