Add shared framework for Swift SDK cross-compilation toolchains - #1821
Merged
Conversation
AttilaTheFun
requested review from
aaronsky,
adincebic,
brentleyjones,
keith,
luispadron and
mattrobmattrob
as code owners
June 23, 2026 17:39
This was referenced Jun 23, 2026
AttilaTheFun
force-pushed
the
swift-sdk-framework
branch
from
June 23, 2026 17:52
2d7936e to
086c902
Compare
Foundation for the per-platform Swift SDK extensions (wasm_sdk, android_sdk, landing as follow-ups). Platform-agnostic building blocks: - swift_toolchain gains linkopts / linker_inputs attributes (and _swift_sdk_linkopts_cc_info) so a toolchain can link against a Swift runtime provided by an SDK rather than the host toolchain. - swift_sdks.bzl: helpers and BUILD-file templates a Swift SDK repository rule uses (bundle download, cc_tool / cc_toolchain / swift_toolchain templates). - toolchains.bzl: the _SDK_TOOLCHAIN_PLATFORM template and a shared exec-constraint helper for generating toolchain() declarations. - swift_sdk_releases.bzl: the SDK download-URL helper and the (initially empty) SWIFT_SDK_RELEASES checksum registry the platform extensions populate. These are exercised end-to-end by the stacked platform PRs; a unit test covers swift_sdk_download_url here.
AttilaTheFun
force-pushed
the
swift-sdk-framework
branch
from
June 23, 2026 23:42
086c902 to
463a9a4
Compare
keith
approved these changes
Jun 23, 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.
Second foundation PR from the #1809 split (see #1820 for the linkshared half).
This adds the platform-agnostic machinery the per-platform Swift SDK PRs build
on:
What this adds
The shared building blocks for downloading a swift.org "Swift SDK" artifact
bundle and turning it into Bazel toolchains:
swift_toolchaingainslinkopts/linker_inputsattributes (and_swift_sdk_linkopts_cc_info) so a toolchain can link against a Swift runtimeprovided by an SDK rather than the host toolchain.
swift_sdks.bzl: helpers and BUILD-file templates a Swift SDK repositoryrule uses (bundle download,
cc_tool/cc_toolchain/swift_toolchaintemplates).
toolchains.bzl: the_SDK_TOOLCHAIN_PLATFORMtemplate and a sharedexec-constraint helper for generating
toolchain()declarations.swift_sdk_releases.bzl: the SDK download-URL helper and the (initiallyempty)
SWIFT_SDK_RELEASESchecksum registry the platform extensionspopulate.
These are deliberately a foundation: they're exercised end-to-end by the stacked
platform PRs (WebAssembly / Android / Windows). A unit test covers
swift_sdk_download_urlin//test:utils.