Skip to content

[Windows] Support toolchain/sdk/runtime discovery through the registry #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks
tristanlabelle opened this issue Feb 4, 2025 · 0 comments
Open
2 tasks

Comments

@tristanlabelle
Copy link
Contributor

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:

  • The Swift toolchain msi’s should register themselves in the registry under a standard structure, and unregister themselves upon uninstallation.
  • The registry structure should allow enumerating
    • The Swift versions installed, and for each version:
      • The path to the toolchain, including compiler, if available
      • The path to the runtime, if applicable
      • The SDKs installed, their paths and redistributable paths

This could look like how the Windows SDK registers its different versions:

Image

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant