Skip to content

Commit

Permalink
Revert "GHA: template the SwiftSyntaxConfig.cmake for LSP builds"
Browse files Browse the repository at this point in the history
This reverts commit 720ca2d.

This works on main, but not on 5.10
  • Loading branch information
hyp committed Dec 15, 2023
1 parent 29072d8 commit d1857dd
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions .github/workflows/swift-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ jobs:
$CACHE="Windows-aarch64.cmake"
# FIXME(compnerd) re-enable runtimes after we sort out compiler-rt
(Get-Content ${{ github.workspace }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake).Replace(' runtimes', '') | Set-Content ${{ github.workspace }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake
(Get-Content ${{ github.workspace }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake).replace(' runtimes', '') | Set-Content ${{ github.workspace }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake
} else {
$CACHE="Windows-x86_64.cmake"
}
Expand Down Expand Up @@ -680,24 +680,6 @@ jobs:
name: compilers-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library

- name: extract swift-syntax
run: |
$module = "${{ github.workspace }}/BinaryCache/1/cmake/modules/SwiftSyntaxConfig.cmake"
$bindir = cygpath -m ${{ github.workspace }}/BinaryCache/1
(Get-Content $module).Replace("${bindir}", '<BINARY_DIR>') | Set-Content $module
New-Item -Path ${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host -ItemType Directory | Out-Null
Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib"
Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host"
Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/swift/host/*.swiftmodule" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host" -Recurse
New-Item -Path ${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules -ItemType Directory | Out-Null
Copy-Item -Path $module -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules"
- name: Upload swift-syntax
uses: actions/upload-artifact@v3
with:
name: swift-syntax-${{ matrix.arch }}
path: ${{ github.workspace }}/BinaryCache/swift-syntax

# TODO(compnerd) this takes ~1h due to the size, see if we can compress first
- uses: actions/upload-artifact@v3
if: false # ${{ needs.context.outputs.debug_info }}
Expand Down Expand Up @@ -1327,11 +1309,6 @@ jobs:
with:
name: windows-sdk-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform
- name: Downlaod swift-syntax
uses: actions/download-artifact@v3
with:
name: swift-syntax-${{ matrix.arch }}
path: ${{ github.workspace }}/BinaryCache/swift-syntax

- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -1417,6 +1394,12 @@ jobs:
ref: ${{ needs.context.outputs.swift_revision }}
path: ${{ github.workspace }}/SourceCache/swift
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-syntax
ref: ${{ needs.context.outputs.swift_syntax_revision }}
path: ${{ github.workspace }}/SourceCache/swift-syntax
show-progress: false

- run: |
$RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin
Expand Down Expand Up @@ -1806,11 +1789,34 @@ jobs:
- name: Build indexstore-db
run: cmake --build ${{ github.workspace }}/BinaryCache/indexstore-db

- name: extract swift-syntax
- name: Configure SwiftSyntax
run: |
$module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake"
$bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax
(Get-Content $module).Replace('<BINARY_DIR>', "${bindir}") | Set-Content $module
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-syntax `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-syntax
- name: Build swift-syntax
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-syntax

- name: Configure SourceKit-LSP
run: |
Expand Down

0 comments on commit d1857dd

Please sign in to comment.