@@ -2878,6 +2878,12 @@ jobs:
2878
2878
ref : ${{ inputs.swift_markdown_revision }}
2879
2879
path : ${{ github.workspace }}/SourceCache/swift-markdown
2880
2880
show-progress : false
2881
+
2882
+ with :
2883
+ repository : swiftlang/swift-build
2884
+ ref : ${{ inputs.swift_build_revision }}
2885
+ path : ${{ github.workspace }}/SourceCache/swift-build
2886
+ show-progress : false
2881
2887
2882
2888
with :
2883
2889
repository : swiftlang/swift-package-manager
@@ -3239,6 +3245,56 @@ jobs:
3239
3245
- name : Build swift-certificates
3240
3246
run : cmake --build ${{ github.workspace }}/BinaryCache/swift-certificates
3241
3247
3248
+ - name : Configure swift-build
3249
+ run : |
3250
+ # Workaround CMake 3.20 issue
3251
+ $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/clang-cl.exe
3252
+ $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe
3253
+ if ("${{ matrix.arch }}" -eq "arm64") {
3254
+ # We use the lld linker to work around erratum 843419 on Cortex-A53
3255
+ # CPUs. Otherwise, this causes link.exe to fail with LNK1322.
3256
+ # See https://github.com/swiftlang/swift/issues/79740 for details.
3257
+ $ArchSpecificFlags = "-use-ld=lld-link"
3258
+ }
3259
+
3260
+ # `CMAKE_SHARED_LINKER_FLAGS` and `CMAKE_SHARED_LINKER_FLAGS_RELEASE`
3261
+ # are set to empty string here to work around the fact that this
3262
+ # project uses either swift.exe or link.exe as the linker.
3263
+ # swift.exe cannot properly parse the link.exe flags directly.
3264
+ # This should be fixed with CMake 4.0 by passing the linker flags with
3265
+ # a `LINKER:` prefix, while setting `CMP0181` to `NEW`.
3266
+ cmake -B ${{ github.workspace }}/BinaryCache/swift-build `
3267
+ -D BUILD_SHARED_LIBS=YES `
3268
+ -D BUILD_TESTING=NO `
3269
+ -D CMAKE_BUILD_TYPE=Release `
3270
+ -D CMAKE_C_COMPILER=${CLANG_CL} `
3271
+ -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
3272
+ -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" `
3273
+ -D CMAKE_CXX_COMPILER=${CLANG_CL} `
3274
+ -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
3275
+ -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
3276
+ -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr `
3277
+ -D CMAKE_Swift_COMPILER=${SWIFTC} `
3278
+ -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
3279
+ -D CMAKE_Swift_COMPILER_WORKS=YES `
3280
+ -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${ArchSpecificFlags} ${{ inputs.CMAKE_Swift_FLAGS }}" `
3281
+ -D CMAKE_Swift_FLAGS_RELEASE="-O" `
3282
+ -D CMAKE_SYSTEM_NAME=Windows `
3283
+ -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
3284
+ -D CMAKE_SHARED_LINKER_FLAGS="" `
3285
+ -D CMAKE_SHARED_LINKER_FLAGS_RELEASE="" `
3286
+ -G Ninja `
3287
+ -S ${{ github.workspace }}/SourceCache/swift-build `
3288
+ -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules `
3289
+ -D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules `
3290
+ -D SwiftDriver_DIR=${{ github.workspace }}/BinaryCache/swift-driver/cmake/modules `
3291
+ -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules `
3292
+ -D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules `
3293
+ -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/include `
3294
+ -D SQLite3_LIBRARY=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/lib/SQLite3.lib
3295
+ - name : Build swift-build
3296
+ run : cmake --build ${{ github.workspace }}/BinaryCache/swift-build
3297
+
3242
3298
- name : extract swift-syntax
3243
3299
run : |
3244
3300
$module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake"
@@ -3277,6 +3333,7 @@ jobs:
3277
3333
-D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/include `
3278
3334
-D SQLite3_LIBRARY=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/lib/SQLite3.lib `
3279
3335
-D SwiftASN1_DIR=${{ github.workspace }}/BinaryCache/swift-asn1/cmake/modules `
3336
+ -D SwiftBuild_DIR=${{ github.workspace }}/BinaryCache/swift-build/cmake/modules `
3280
3337
-D SwiftCertificates_DIR=${{ github.workspace }}/BinaryCache/swift-certificates/cmake/modules `
3281
3338
-D SwiftCollections_DIR=${{ github.workspace }}/BinaryCache/swift-collections/cmake/modules `
3282
3339
-D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules `
@@ -3453,6 +3510,8 @@ jobs:
3453
3510
run : cmake --build ${{ github.workspace }}/BinaryCache/swift-tools-support-core --target install
3454
3511
- name : Install swift-driver
3455
3512
run : cmake --build ${{ github.workspace }}/BinaryCache/swift-driver --target install
3513
+ - name : Install swift-build
3514
+ run : cmake --build ${{ github.workspace }}/BinaryCache/swift-build --target install
3456
3515
- name : Install swift-package-manager
3457
3516
run : cmake --build ${{ github.workspace }}/BinaryCache/swift-package-manager --target install
3458
3517
- name : Install SourceKit-LSP
0 commit comments