feat: add Linux x86_64 support to the prebuilt archive#20
Merged
Conversation
83bf2cb to
ca64475
Compare
congt
approved these changes
May 28, 2026
e4d392c to
b7a351f
Compare
Build SwiftSyntax for both macOS arm64 and Linux x86_64 in CI, then package them into a single release tarball with a generated BUILD.bazel that select()s on @platforms//os + @platforms//cpu so one archive_override works for every supported platform. build.sh is split into two phases (`build` per platform, `package` once) so the workflow can fan out across heterogeneous runners and fan back in for a single release artifact.
b7a351f to
64ae514
Compare
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.
Summary
build.shinto two phases:build(per-platform binary build, run once perTARGET_PLATFORM) andpackage(combines staged platform tarballs into the final release archive).macos-arm64/,linux-x86_64/) of.a/.swiftinterface/.swiftdoc. The generatedBUILD.bazelusesselect()over@platforms//os+@platforms//cpuconfig_settings so a singlearchive_overrideURL works for any consumer.dry-run.ymlandbuild-publish.ymlto fan out to a macOS job + a Linux job, then fan in to a single packaging/publish job. Linux usesswift-actions/setup-swift@v2for the Swift toolchain and pulls a static buildozer release.apple/swift-syntaxcheckout'sBUILD.bazelandutils/bazel/swift_syntax_library.bzlon Linux builds to drop the@build_bazel_rules_appleload +ios_xctestrun_runner/ios_unit_testreferences that the prebuilt doesn't need.Why
Consuming the current prebuilt on a Linux Bazel build fails with
module 'SwiftSyntax' was created for incompatible target arm64-apple-macos13.0, because the.aand.swiftinterfacefiles in the archive are arm64-apple-macos only. Downstream repos that want to run their Bazel build on Blox/Linux runners have had to work around this by skipping thearchive_overrideon Linux. With per-platform artifacts, that workaround can go away.