Build and test Swift natively on a Windows host#1819
Merged
Conversation
2ae5e50 to
a52d1be
Compare
a52d1be to
fa2fd96
Compare
keith
reviewed
Jun 24, 2026
61f5bd9 to
5f81fc8
Compare
keith
reviewed
Jul 2, 2026
Builds on the linkshared and Swift SDK framework PRs. Adds native Windows host toolchain support to the standalone toolchain path (the <arch>-unknown-windows-msvc triple, MSVC link.exe semantics, auto-configuring a toolchain from an installed swiftc), plus independent test_observer / worker fixes (extended-length paths, space-in-path object names, corelibs-xctest runner) that were bundled into the original combined PR. CI gains a Windows task building //tools/... and the xplatform examples and running the xctest example.
- Probe Python interpreters more robustly: drop the in-function nil guard (the caller now checks `candidate and ...`), prefer python3-named binaries before unsuffixed ones, and confirm the interpreter is Python 3 (the caller needs the Python 3 plistlib API), addressing the "could `python` be Python 2?" concern. - Trim several over-long comments (object-file space sanitization, the Windows triple synthesis, the cc-toolchain clang requirement, and the Info.plist / ProgramData notes) per review.
Trim the target-triple and clang-carve-out comments per review. Claude-Session: https://claude.ai/code/session_01SmG1kqA3qB4WsLGU2xavuJ
5f81fc8 to
ebabbae
Compare
keith
approved these changes
Jul 6, 2026
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.
Windows host toolchain support + miscellaneous fixes, part of the #1809 split, on
top of the now-merged foundation PRs #1820 (
swift_binary(linkshared)) and #1821(Swift-SDK framework).
What this adds
Native Windows host toolchain support on the standalone toolchain path (the
<arch>-unknown-windows-msvctriple, MSVClink.exesemantics, auto-configuringa toolchain from an installed
swiftc), plus independenttest_observer/worker fixes (extended-length paths, space-in-path object names, corelibs-xctest
runner) that were bundled into the original combined PR. CI gains a Windows task
building
//tools/...+ the xplatform examples and running thexctestexample.Open questions
both
link.exeand a hermeticlld-linkaccept the/ALTERNATENAME//IGNORE:4217flags used here. I can key the flags off the linker rather thanthe OS if you want it to compose with
clang-clexplicitly. (@dzbarsky)swift_autoconfigurationparses the SDKInfo.plist(a plist,not JSON) in a repository rule. The clean fix is to parse
XCTEST_VERSIONinStarlark and drop Python; I'd do it in a follow-up CI can validate, since I
can't exercise the Windows path locally. (@dzbarsky)