Today, it is difficult to have multiple Swift toolchains installed on a machine and use the appropriate one as needed due to a few reasons:
- The user install a toolchain or one component thereof (such as an SDK) under a arbitrary paths
- The toolchain is placed under the
%Path% environment variable
- The
%SDKROOT% environment variable points to a single SDK.
We would like to migrate to a model where we can enumerate multiple SDKs and toolchains installed on the machine by using registry entries, similar to what the Windows SDK does for its multiple versions. This would allow us to eliminate the %SDKROOT% environment variable and provide tooling that can select which version of the compiler, or SDK to use.
Specifically:
This could look like how the Windows SDK registers its different versions:

A rough draft of a registry structure:
Swift/
0.0.0-c78f10e/
...
6.0.1/
Toolchain
"C:\Users\micro\AppData\Local\Programs\Swift\Toolchains\6.0.1+Asserts"
"C:\Users\micro\AppData\Local\Programs\Swift\Toolchains\6.0.1+NoAsserts"
Runtimes/
x86_64 "C:\Users\micro\AppData\Local\Programs\Swift\Runtimes\0.0.0\usr\bin"
SDKs/
Windows-x86_64 "C:\Users\micro\AppData\Local\Programs\Swift\Platforms\0.0.0\Windows.platform\Developer\SDKs\Windows.sdk"
RuntimeMSM "C:\Users\micro\AppData\Local\Programs\Swift\Redistributables\0.0.0\rtl.amd64.msm"
Windows-arm64 "C:\Users\micro\AppData\Local\Programs\Swift\Platforms\0.0.0\Windows.platform\Developer\SDKs\Windows.sdk"
Today, it is difficult to have multiple Swift toolchains installed on a machine and use the appropriate one as needed due to a few reasons:
%Path%environment variable%SDKROOT%environment variable points to a single SDK.We would like to migrate to a model where we can enumerate multiple SDKs and toolchains installed on the machine by using registry entries, similar to what the Windows SDK does for its multiple versions. This would allow us to eliminate the
%SDKROOT%environment variable and provide tooling that can select which version of the compiler, or SDK to use.Specifically:
This could look like how the Windows SDK registers its different versions:
A rough draft of a registry structure: