Skip to content

Commit b28b550

Browse files
authored
Build: use configure-cmake-project action in debugging_tools job (#1019)
* Use configure-cmake-project in debugging_tools * Disable caching * [debug] Simplify change * [debug] Add back cmake-defines * Add sdk path * Enable caching
1 parent 47c1779 commit b28b550

File tree

1 file changed

+40
-15
lines changed

1 file changed

+40
-15
lines changed

.github/workflows/swift-toolchain.yml

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3812,6 +3812,24 @@ jobs:
38123812
with:
38133813
setup-vs-dev-env: true
38143814
host-arch: ${{ matrix.arch }}
3815+
- name: Compute workspace hash
3816+
id: workspace_hash
3817+
run: |
3818+
$stringAsStream = [System.IO.MemoryStream]::new()
3819+
$writer = [System.IO.StreamWriter]::new($stringAsStream)
3820+
$writer.write("${{ github.workspace }}")
3821+
$writer.Flush()
3822+
$stringAsStream.Position = 0
3823+
$hash = (Get-FileHash -Algorithm SHA256 -InputStream $stringAsStream).Hash
3824+
echo "hash=$hash" >> $env:GITHUB_OUTPUT
3825+
- name: Setup sccache
3826+
uses: ./SourceCache/ci-build/.github/actions/setup-sccache
3827+
with:
3828+
s3-bucket: ${{ vars.SCCACHE_S3_BUCKET }}
3829+
aws-region: ${{ vars.SCCACHE_AWS_REGION }}
3830+
aws-arn: ${{ vars.SCCACHE_AWS_ARN }}
3831+
disk-max-size: 100M
3832+
disk-cache-key: ${{ steps.workspace_hash.outputs.hash }}-${{ matrix.os }}-${{ matrix.arch }}-debugging-tools
38153833

38163834
- name: Download swift-argument-parser
38173835
uses: actions/download-artifact@v4
@@ -3877,22 +3895,29 @@ jobs:
38773895
path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
38783896

38793897
- name: Configure swift-inspect
3880-
run: |
3881-
$SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe
3898+
uses: ./SourceCache/ci-build/.github/actions/configure-cmake-project
3899+
with:
3900+
project-name: swift-inspect
3901+
swift-version: ${{ inputs.swift_version }}
3902+
enable-caching: true
3903+
debug-info: ${{ inputs.debug_info }}
3904+
build-os: ${{ inputs.build_os }}
3905+
build-arch: ${{ inputs.build_arch }}
3906+
os: ${{ matrix.os }}
3907+
arch: ${{ matrix.arch }}
3908+
src-dir: ${{ github.workspace }}/SourceCache/swift/tools/swift-inspect
3909+
bin-dir: ${{ github.workspace }}/BinaryCache/${{ matrix.arch }}/swift-inspect
3910+
install-dir: ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr
3911+
swift-sdk-path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk
3912+
built-compilers: '@("Swift")'
3913+
cmake-defines: |
3914+
@{
3915+
'CMAKE_Swift_FLAGS' = @(
3916+
"-Xcc",
3917+
"-I${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/include/swift/SwiftRemoteMirror");
3918+
'ArgumentParser_DIR' = "${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules";
3919+
}
38823920
3883-
cmake -B ${{ github.workspace }}/BinaryCache/${{ matrix.arch }}/swift-inspect `
3884-
-D CMAKE_BUILD_TYPE=Release `
3885-
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr `
3886-
-D CMAKE_Swift_COMPILER=${SWIFTC} `
3887-
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
3888-
-D CMAKE_Swift_COMPILER_WORKS=YES `
3889-
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }} -Xcc `"-I${env:SDKROOT}/usr/include/swift/SwiftRemoteMirror`"" `
3890-
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
3891-
-D CMAKE_SYSTEM_NAME=Windows `
3892-
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
3893-
-G Ninja `
3894-
-S ${{ github.workspace }}/SourceCache/swift/tools/swift-inspect `
3895-
-D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules
38963921
- name: Build swift-inspect
38973922
run: cmake --build ${{ github.workspace }}/BinaryCache/${{ matrix.arch }}/swift-inspect
38983923

0 commit comments

Comments
 (0)