Skip to content

Commit f22c1b6

Browse files
committed
GHA: share the pinned toolchain definition
Swift does not have a stable ABI. We need to ensure that the toolchain that is used in different phases is identical. Hoist the toolchain version definition to global state.
1 parent 41c8474 commit f22c1b6

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/swift-toolchain.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,14 @@ on:
258258
env:
259259
SCCACHE_DIRECT: on
260260

261+
# Workaround for ... on macOS preventing us from using the 5.10 toolchain release.
262+
WORKAROUND_MACOS_PINNED_BOOTSTRAP_TOOLCHAIN_BRANCH: swift-6.0.1-release
263+
WORKAROUND_MACOS_PINNED_BOOTSTRAP_TOOLCHAIN_TAG: 6.0.1-RELEASE
264+
265+
# Workaround for ... on Windows preventing us from using the 5.10 toolchain release.
266+
WORKAROUND_WINDOWS_PINNED_BOOTSTRAP_TOOLCHAIN_REPO: thebrowsercompany/swift-build
267+
WORKAROUND_WINDOWS_PINNED_BOOTSTRAP_TOOLCHAIN_RELEASE: 20231016.5
268+
261269
defaults:
262270
run:
263271
shell: pwsh
@@ -760,8 +768,8 @@ jobs:
760768
if: inputs.build_os == 'Darwin'
761769
uses: compnerd/gha-setup-swift@b6c5fc1ed5b5439ada8e7661985acb09ad8c3ba2 # main
762770
with:
763-
branch: swift-6.0.1-release
764-
tag: 6.0.1-RELEASE
771+
branch: ${{ env.WORKAROUND_MACOS_PINNED_BOOTSTRAP_TOOLCHAIN_BRANCH }}
772+
tag: ${{ env.WORKAROUND_MACOS_PINNED_BOOTSTRAP_TOOLCHAIN_TAG }}
765773

766774
- name: Build early swift-driver
767775
run: |
@@ -913,10 +921,10 @@ jobs:
913921
- name: Install Swift Toolchain
914922
uses: compnerd/gha-setup-swift@b6c5fc1ed5b5439ada8e7661985acb09ad8c3ba2 # main
915923
with:
916-
github-repo: thebrowsercompany/swift-build
924+
github-repo: ${{ env.WORKAROUND_WINDOWS_PINNED_BOOTSTRAP_TOOLCHAIN_REPO }}
917925
github-token: ${{ secrets.GITHUB_TOKEN }}
918926
release-asset-name: installer-amd64.exe
919-
release-tag-name: '20231016.5'
927+
release-tag-name: ${{ env.WORKAROUND_WINDOWS_PINNED_BOOTSTRAP_TOOLCHAIN_RELEASE }}
920928

921929
- uses: nttld/setup-ndk@v1
922930
id: setup-ndk
@@ -1576,10 +1584,10 @@ jobs:
15761584
- name: Install Swift Toolchain
15771585
uses: compnerd/gha-setup-swift@b6c5fc1ed5b5439ada8e7661985acb09ad8c3ba2 # main
15781586
with:
1579-
github-repo: thebrowsercompany/swift-build
1587+
github-repo: ${{ env.WORKAROUND_WINDOWS_PINNED_BOOTSTRAP_TOOLCHAIN_REPO }}
15801588
github-token: ${{ secrets.GITHUB_TOKEN }}
15811589
release-asset-name: installer-amd64.exe
1582-
release-tag-name: '20231016.5'
1590+
release-tag-name: ${{ env.WORKAROUND_WINDOWS_PINNED_BOOTSTRAP_TOOLCHAIN_RELEASE }}
15831591

15841592
# NOTE(compnerd): we execute unconditionally as we use CMake from VSDevEnv
15851593
- uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main

0 commit comments

Comments
 (0)