Skip to content

Add Windows conformance runner and testee support#28130

Open
dcodeIO wants to merge 1 commit into
protocolbuffers:mainfrom
dcodeIO:windows
Open

Add Windows conformance runner and testee support#28130
dcodeIO wants to merge 1 commit into
protocolbuffers:mainfrom
dcodeIO:windows

Conversation

@dcodeIO

@dcodeIO dcodeIO commented Jun 21, 2026

Copy link
Copy Markdown

Adds Windows support for the conformance runner and C++ conformance testee. For the conformance runner, this splits ForkPipeRunner into POSIX and Win32 implementations. The testee is switched to portable FILE* I/O, with binary mode on Windows.

Also makes two related changes:

  • waitpid(..., WEXITED) is changed to waitpid(..., 0) because WEXITED is a waitid() flag. waitpid(..., 0) already waits for the child to terminate.
  • Adds protobuf_configure_target to the CMake conformance targets so they get the necessary target flags, e.g. /utf-8, which is important on Windows.

Otherwise wires the change into CI so the Windows target functionally mirrors the existing macOS target.

Resolves this existing Windows TODO in fork_pipe_runner.cc:

// TODO: make this work on Windows, instead of using these
// UNIX-specific APIs.
//
// There is a platform-agnostic API in
//    src/google/protobuf/compiler/subprocess.h
//
// However that API only supports sending a single message to the subprocess.
// We really want to be able to send messages and receive responses one at a
// time:
//
// 1. Spawning a new process for each test would take way too long for thousands
//    of tests and subprocesses like java that can take 100ms or more to start
//    up.
//
// 2. Sending all the tests in one big message and receiving all results in one
//    big message would take away our visibility about which test(s) caused a
//    crash or other fatal error.  It would also give us only a single failure
//    instead of all of them.

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