Skip to content

Support building on Windows (MSVC) - #305

Open
TTC-NateC wants to merge 1 commit into
antithesishq:mainfrom
TTC-NateC:windows-0.7.3
Open

Support building on Windows (MSVC)#305
TTC-NateC wants to merge 1 commit into
antithesishq:mainfrom
TTC-NateC:windows-0.7.3

Conversation

@TTC-NateC

Copy link
Copy Markdown

Two in-repo crates assumed a Unix host and broke the x86_64-pc-windows-msvc build. Neither driver was buildable on Windows before this. Both fixes are behavior-neutral on Unix.

antithesis-fuzzer: the libvoidstar shim passed the GCC/Clang-only flag -Wextra to cl.exe (which rejects it) and included <dlfcn.h> to dlopen the Linux-only libvoidstar coverage library. Use flag_if_supported("-Wextra") so MSVC skips it, and compile no-op stubs under _WIN32. This matches the existing runtime behavior on any non-Antithesis host, where libvoidstar is absent and every coverage call already no-ops; the exported C ABI is unchanged.

cdp: the browser transport polled a raw socket file descriptor through mio::unix::SourceFd, which does not exist on Windows (sockets have no fd, and mio cannot register an arbitrary foreign socket there). cdp is a hard dependency of the always-compiled browser driver, so this blocked the entire build. Switch the transport to mio::net::TcpStream -- a first-class mio source on every platform -- driving the tungstenite handshake non-blocking via client_with_config, and enable mio's "net" feature. Only plain ws:// to a local browser was ever supported (TLS was rejected), so nothing is lost. The result is a single code path for all platforms rather than Windows-specific branches.

Verified on Windows: the release CLI builds with both drivers, and bombadil browser test --headless connects to Chrome and reports property violations. The terminal driver builds but remains runtime-unstable on Windows (pre-existing, unrelated to these changes).

Two in-repo crates assumed a Unix host and broke the x86_64-pc-windows-msvc
build. Neither driver was buildable on Windows before this. Both fixes are
behavior-neutral on Unix.

antithesis-fuzzer: the libvoidstar shim passed the GCC/Clang-only flag
-Wextra to cl.exe (which rejects it) and included <dlfcn.h> to dlopen the
Linux-only libvoidstar coverage library. Use flag_if_supported("-Wextra") so
MSVC skips it, and compile no-op stubs under _WIN32. This matches the existing
runtime behavior on any non-Antithesis host, where libvoidstar is absent and
every coverage call already no-ops; the exported C ABI is unchanged.

cdp: the browser transport polled a raw socket file descriptor through
mio::unix::SourceFd, which does not exist on Windows (sockets have no fd, and
mio cannot register an arbitrary foreign socket there). cdp is a hard
dependency of the always-compiled browser driver, so this blocked the entire
build. Switch the transport to mio::net::TcpStream -- a first-class mio source
on every platform -- driving the tungstenite handshake non-blocking via
client_with_config, and enable mio's "net" feature. Only plain ws:// to a
local browser was ever supported (TLS was rejected), so nothing is lost. The
result is a single code path for all platforms rather than Windows-specific
branches.

Verified on Windows: the release CLI builds with both drivers, and
`bombadil browser test --headless` connects to Chrome and reports property
violations. The terminal driver builds but remains runtime-unstable on Windows
(pre-existing, unrelated to these changes).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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