Skip to content

feat: add Linux x86_64 support to the prebuilt archive#20

Merged
luispadron merged 1 commit into
mainfrom
luis/linux-support
May 28, 2026
Merged

feat: add Linux x86_64 support to the prebuilt archive#20
luispadron merged 1 commit into
mainfrom
luis/linux-support

Conversation

@luispadron
Copy link
Copy Markdown
Collaborator

@luispadron luispadron commented May 5, 2026

Summary

  • Refactors build.sh into two phases: build (per-platform binary build, run once per TARGET_PLATFORM) and package (combines staged platform tarballs into the final release archive).
  • The released tarball now ships per-platform subdirs (macos-arm64/, linux-x86_64/) of .a / .swiftinterface / .swiftdoc. The generated BUILD.bazel uses select() over @platforms//os + @platforms//cpu config_settings so a single archive_override URL works for any consumer.
  • Updates dry-run.yml and build-publish.yml to fan out to a macOS job + a Linux job, then fan in to a single packaging/publish job. Linux uses swift-actions/setup-swift@v2 for the Swift toolchain and pulls a static buildozer release.
  • Patches the apple/swift-syntax checkout's BUILD.bazel and utils/bazel/swift_syntax_library.bzl on Linux builds to drop the @build_bazel_rules_apple load + ios_xctestrun_runner / ios_unit_test references that the prebuilt doesn't need.
  • README updated to document the supported platforms and the two build phases.

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 .a and .swiftinterface files 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 the archive_override on Linux. With per-platform artifacts, that workaround can go away.

Comment thread .github/workflows/build-publish.yml Fixed
Comment thread .github/workflows/dry-run.yml Fixed
Comment thread .github/workflows/build-publish.yml Fixed
Comment thread .github/workflows/dry-run.yml Fixed
Comment thread .github/workflows/build-publish.yml Fixed
Comment thread .github/workflows/build-publish.yml Fixed
Comment thread .github/workflows/build-publish.yml Fixed
Comment thread .github/workflows/dry-run.yml Fixed
@luispadron luispadron marked this pull request as ready for review May 6, 2026 03:23
@luispadron luispadron force-pushed the luis/linux-support branch from 83bf2cb to ca64475 Compare May 28, 2026 15:41
@luispadron luispadron requested a review from congt May 28, 2026 16:02
@luispadron luispadron force-pushed the luis/linux-support branch 6 times, most recently from e4d392c to b7a351f Compare May 28, 2026 18:05
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.
@luispadron luispadron force-pushed the luis/linux-support branch from b7a351f to 64ae514 Compare May 28, 2026 19:52
@luispadron luispadron merged commit 007f077 into main May 28, 2026
8 checks passed
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.

3 participants