Skip to content

[Windows] Build NIOPerformanceTester and NIOCrashTester in CI - #3646

Merged
glbrntt merged 1 commit into
apple:mainfrom
jakepetroules:windows-ci-more-targets
Jul 8, 2026
Merged

glbrntt merged 1 commit into
apple:mainfrom
jakepetroules:windows-ci-more-targets

Conversation

@jakepetroules

Copy link
Copy Markdown
Member

Add the two remaining non-test, non-NIOFS targets to the Windows CI build list.

NIOPerformanceTester builds and runs on Windows. The only obstacle was the setbuf(stdout, nil) call: stdout is a macro on the Windows CRT that Swift cannot reference directly. Add a CNIOWindows_setStdoutUnbuffered() wrapper so the C compiler expands the macro (keeping us correct if its definition ever changes), and call it on Windows.

NIOCrashTester cannot function on Windows: its OutputGrepper captures a child process's output through a pipe channel (NIOPipeBootstrap), which deliberately fatalErrors on Windows, and relies on Foundation.Pipe fd conversion plus Unix-signal crash detection. Extend the existing !canImport(Darwin) || os(macOS) guard with && !os(Windows) across the target so it compiles to a no-op on Windows, just as it already does on the non-macOS Darwin platforms.

Add the two remaining non-test, non-NIOFS targets to the Windows CI build
list.

NIOPerformanceTester builds and runs on Windows. The only obstacle was the
`setbuf(stdout, nil)` call: `stdout` is a macro on the Windows CRT that Swift
cannot reference directly. Add a `CNIOWindows_setStdoutUnbuffered()` wrapper so
the C compiler expands the macro (keeping us correct if its definition ever
changes), and call it on Windows.

NIOCrashTester cannot function on Windows: its OutputGrepper captures a child
process's output through a pipe channel (`NIOPipeBootstrap`), which deliberately
`fatalError`s on Windows, and relies on `Foundation.Pipe` fd conversion plus
Unix-signal crash detection. Extend the existing `!canImport(Darwin) ||
os(macOS)` guard with `&& !os(Windows)` across the target so it compiles to a
no-op on Windows, just as it already does on the non-macOS Darwin platforms.
@jakepetroules

Copy link
Copy Markdown
Member Author

After this, only the NIOFS family of targets remain, and then we'll have all non-test targets successfully building for Windows.

Once NIOFS is taken care of, we can collapse the CI to a simple swift build invocation, and then start working on getting the tests successfully building and running.

@glbrntt glbrntt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Jake!

@glbrntt glbrntt added the πŸ”¨ semver/patch No public API change. label Jul 8, 2026
@glbrntt
glbrntt merged commit 68631de into apple:main Jul 8, 2026
99 of 114 checks passed
@jakepetroules
jakepetroules deleted the windows-ci-more-targets branch July 8, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

πŸ”¨ semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants