Skip to content

[Windows] Build currently-supported targets in CI#3644

Merged
glbrntt merged 2 commits into
apple:mainfrom
jakepetroules:windows-ci
Jul 3, 2026
Merged

[Windows] Build currently-supported targets in CI#3644
glbrntt merged 2 commits into
apple:mainfrom
jakepetroules:windows-ci

Conversation

@jakepetroules

Copy link
Copy Markdown
Member

Add a Windows PR/main CI job that builds the targets which compile cleanly today: _NIOBase64, _NIOConcurrency, _NIODataStructures, NIOConcurrencyHelpers, NIOCore, NIOEmbedded, NIOFoundationCompat, NIOFoundationEssentialsCompat, NIOHTTP1, NIOTLS, NIOWebSocket. The remaining targets (NIOPosix, NIO, NIOTestUtils, downstream tests, examples) still fail on Windows and are not yet covered.

The existing unit-tests workflow path runs swift test, which does not accept --target, so flipping windows_6_3_enabled there would attempt to test the whole package and fail. Instead this is an inline job that runs swift build with explicit --target flags. As more targets come up on Windows we'll extend the list, then eventually retire this job in favor of windows_6_3_enabled when swift test of the whole package is green.

Comment thread .github/workflows/main.yml Outdated
shell: pwsh
- name: Pull Docker image
run: docker pull swift:6.3-windowsservercore-ltsc2022
- name: Build currently-supported targets

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.

@rnro is there a more canonical way to do this?

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.

You can enable Windows in the unit-tests job above with a boolean flag, or if you don't want testing use swift_test_matrix.yml as a custom matrix job, disabling non-windows platforms and with swift build as the build command.

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.

Sorry, I meant for building specific targets. Would the matrix job be more suitable than what Jake has proposed?

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.

I believe so, you can focus on just what is the intent of the job and have the Swift/Windows version concerns, configuration and docker shenanigans delegated. You'd just have

MATRIX_WINDOWS_COMMAND: swift build --target _NIOBase64 --target _NIOConcurrency --target _NIODataStructures --target NIOConcurrencyHelpers --target NIOCore --target NIOEmbedded --target NIOFoundationCompat --target NIOFoundationEssentialsCompat --target NIOHTTP1 --target NIOTLS --target NIOWebSocket"

You'd have to also specify

MATRIX_LINUX_6_0_ENABLED: false
...
MATRIX_LINUX_6_3_ENABLED: false

unless a general "disable Linux" flag was added as an enhancement.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated the PR. Is this what you were looking for?

@jakepetroules jakepetroules force-pushed the windows-ci branch 2 times, most recently from ed434e6 to 9cf1a95 Compare July 3, 2026 07:40
Add a Windows PR/main CI job that builds the targets which compile
cleanly today: _NIOBase64, _NIOConcurrency, _NIODataStructures,
NIOConcurrencyHelpers, NIOCore, NIOEmbedded, NIOFoundationCompat,
NIOFoundationEssentialsCompat, NIOHTTP1, NIOTLS, NIOWebSocket. The
remaining targets (NIOPosix, NIO, NIOTestUtils, downstream tests,
examples) still fail on Windows and are not yet covered.

The existing unit-tests workflow path runs swift test, which does
not accept --target, so flipping windows_6_3_enabled there would
attempt to test the whole package and fail. Instead this delegates
to the shared swift_test_matrix workflow with a custom matrix that
disables all Linux versions, enables Windows 6.3, and overrides
MATRIX_WINDOWS_COMMAND with the targeted swift build invocation.
Docker image, runner, and container-setup concerns stay in the
shared machinery. As more targets come up on Windows we will extend
the list, then retire this job in favor of windows_6_3_enabled
when swift test of the whole package is green.
@glbrntt glbrntt added the semver/none No version bump required. label Jul 3, 2026

@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.

LGTM, thanks Jake!

@glbrntt glbrntt merged commit a6ffe7c into apple:main Jul 3, 2026
54 of 58 checks passed
@jakepetroules jakepetroules deleted the windows-ci branch July 4, 2026 23:08
@jakepetroules jakepetroules mentioned this pull request Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants