Hello Windows Developers,
This post has two aims:
- To notify users of a significant upcoming change.
- To recruit additional early testers.
Over the past few months, there’s been quiet but substantial progress on improving the Swift SDK for Windows. As these changes near completion, I’m seeking broader external testing and validation to help surface any remaining issues.
In recent builds—specifically those from The Browser Company, since there haven’t been releases on swift.org for over a month—the Swift SDK for Windows has introduced a new platform SDK: WindowsExperimental.sdk
.
Experimental SDK
While still labeled experimental, this SDK is now considerably more stable. It represents a build of the runtime using the new build system developed by @etcwilde, @justice-adams-apple, @edymtt, and others. In theory, this should be functionally identical to the existing runtime.
Static Runtime
A key aspect of this iteration is the distribution of a static variant of the SDK for Windows—a static runtime build.
Current Limitations
At present, this SDK lacks the following components:
- Differentiation
- SwiftRemoteMirror
- C++ Interop overlays
Notably, Foundation support is absent. This is because Foundation, when built for static linking on Windows, conflicts with system libraries—specifically due to ICU collisions. This is a temporary limitation, pending updates.
Details:
Windows ships ICU, and Foundation also bundles ICU. With static linking, the system ICU takes precedence, causing runtime conflicts and crashes. This will eventually be mitigated via ICU’s symbol renaming, but the current ClangImporter doesn’t support this.Recent compiler features—macro-based alias importing (c66d43e) and
ImportDeclAliases
(c08372a)—require updating to the latest compiler in swift-foundation CI before Foundation can be rebuilt for static linking.
Foundation support will be restored once these PRs are merged:
Other missing pieces are being addressed:
- Differentiation overlay search/link
- Build Differentiation in experimental SDK
- Package _Differentiation in experimental SDK
For C++ Interop overlays, support must still be added to the new build system.
The SwiftRemoteMirror
module revealed further ODR violations that must be resolved before it can be included.
Details:
Both the Swift Runtime and SwiftRemoteMirror are host libraries embedding copies of LLVM libraries (ADT
,Support
, and for RemoteMirror,BinaryObject
andObject
). We pin and namespace the first two to avoid conflicts, but need to update the pinned version and apply this to the new libraries as well.To minimize the TCB, binary size, and maintenance, we trim interfaces to essentials. This work must be repeated for the updated libraries.
Dynamic Runtime
As the runtime build converges, the dynamic variant will also be added to the SDK. This will ultimately make the experimental SDK a full drop-in replacement for the existing one.
Notable Changes
A user-visible change: dynamic modules will now embed a manifest resource, enabling use with Win32 SxS. This addresses a longstanding limitation—previously, only a single runtime could be installed. With embedded manifests, application authors can specify the runtime version, and the system will load the correct version from those installed. If installed with elevated privileges, the runtime can be placed in the GAC for sharing across applications, removing the need to bundle it with every executable.
For developers: Windows versioning uses a four-part, 16-bit value (65535 per component). Consequently, only one development runtime can be installed at a time, though multiple release/RC runtimes are supported. Runtimes are versioned as [major].[build]
(e.g., 6.1.0), with the build number incrementing per release.
Testing
The new runtime has not been exhaustively tested, but it has passed enough testing to warrant broader use. Testing so far has focused on building and using the early swift-driver on Windows. PR #76574 enables this, and while it’s not ready to merge due to Foundation issues (and a known CI-specific failure under investigation), it suffices to build the toolchain and test suite.
Implications
Care has been taken to minimize disruption, but the SDK isn’t yet a seamless replacement. It installs in parallel and requires explicit selection. The simplest way is to update the SDKROOT
environment variable to point to the new SDK, or use the -sdk ...
flag in your Swift invocation. Work is ongoing to enable easier switching via tcrun
(e.g., tcrun -sdk WindowsExperimental swift build
). Contributions are welcome.
As dynamic runtime packaging matures, further work will be needed to generalize SDK packaging. @mhegazy is also working on installer improvements to support additional toolchain variants (e.g., NoAsserts
).
How to Get Involved
Note that this is a call for early adopters. Due to the Foundation changes not being merged, testing this currently will require applying the changes and building a toolchain locally. If your applications could benefit from static runtime linking or you’re interested in experimenting, please build a new toolchain with the Foundation changes and try the new SDK, reporting any issues. Broader help will especially be needed for testing and validating the dynamic builds and Win32 SxS support to ensure readiness for production use. I intend to make a follow up post in the coming weeks () once the necessary changes are merged and we have a toolchain with the new SDK in its entirety.
As usual, please report any issues through GitHub Issues.