Skip to content

Dynamically determine the swift compiler version. #8708

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dschaefer2
Copy link
Member

Prebuilts for macros and the automated downloading of SwiftSDKs need to know the version of the compiler so we can fetch compatible binaries. The swiftc compiler has a --print-target-info options which dumps out a JSON structure that contains the compilerVersion. We already use info in this structure to determine the hostTriple for the UserToolchain.

This adds the swiftCompilerVersion to UserToolchain that uses a couple of regex's to pull out the Swift compiler version. This is then used by the prebuilts feature instead of our current hardcodeing of the swift toolchain version.

This also turns the prebuilts feature on by default which was supposed to be done in the last update.

Cherry pick of #8707

Prebuilts for macros and the automated downloading of SwiftSDKs need to
know the version of the compiler so we can fetch compatible binaries.
The swiftc compiler has a --print-target-info options which dumps out a
JSON structure that contains the compilerVersion. We already use info in
this structure to determine the hostTriple for the UserToolchain.

This adds the swiftCompilerVersion to UserToolchain that uses a couple
of regex's to pull out the Swift compiler version. This is then used by
the prebuilts feature instead of our current hardcodeing of the swift
toolchain version.

This also turns the prebuilts feature on by default which was supposed
to be done in the last update.
@dschaefer2 dschaefer2 force-pushed the main-prebuilt-compiler-tag branch from 92831ae to 041b053 Compare May 23, 2025 14:03
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

Successfully merging this pull request may close these issues.

2 participants