Repository navigation
[Windows] Build NIOPerformanceTester and NIOCrashTester in CI - #3646
Merged
Merged
Conversation
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.
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 |
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.
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:stdoutis a macro on the Windows CRT that Swift cannot reference directly. Add aCNIOWindows_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 deliberatelyfatalErrors on Windows, and relies onFoundation.Pipefd 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.