Skip to content

Commit 31e648b

Browse files
committed
GHA: re-use the swift-syntax build for SPM
SPM has a newly minted dependency on swift-syntax. This needs to be fulfilled and re-building the dependency and statically linking will increase the binary size ~70M (*3). Use dynamic linking to avoid that and to save build time.
1 parent e9a4b12 commit 31e648b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/swift-toolchain.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,12 @@ jobs:
18941894
- name: Build swift-certificates
18951895
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-certificates
18961896

1897+
- name: extract swift-syntax
1898+
run: |
1899+
$module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake"
1900+
$bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax
1901+
(Get-Content $module).Replace('<BINARY_DIR>', "${bindir}") | Set-Content $module
1902+
18971903
- name: Configure swift-package-manager
18981904
run: |
18991905
# Workaround CMake 3.20 issue
@@ -1930,6 +1936,7 @@ jobs:
19301936
-D SwiftCollections_DIR=${{ github.workspace }}/BinaryCache/swift-collections/cmake/modules `
19311937
-D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules `
19321938
-D SwiftDriver_DIR=${{ github.workspace }}/BinaryCache/swift-driver/cmake/modules `
1939+
-D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules `
19331940
-D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules `
19341941
-D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules `
19351942
-D Yams_DIR=${{ github.workspace }}/BinaryCache/yams/cmake/modules
@@ -1963,12 +1970,6 @@ jobs:
19631970
- name: Build Markdown
19641971
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-markdown
19651972

1966-
- name: extract swift-syntax
1967-
run: |
1968-
$module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake"
1969-
$bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax
1970-
(Get-Content $module).Replace('<BINARY_DIR>', "${bindir}") | Set-Content $module
1971-
19721973
- name: Configure Format
19731974
run: |
19741975
# Workaround CMake 3.20 issue

0 commit comments

Comments
 (0)