Skip to content

Commit 876ec4a

Browse files
compnerdhyp
andcommitted
GHA: adjustments for the SDK phase
Adjust the paths for the SDK phase, unify the swift-corelibs-foundation checkout. Co-authored-by: Alex Lorenz <[email protected]>
1 parent ecbfb22 commit 876ec4a

File tree

1 file changed

+54
-31
lines changed

1 file changed

+54
-31
lines changed

.github/workflows/swift-toolchain.yml

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,6 @@ jobs:
15811581
searchPattern: '**/*.exe'
15821582

15831583
sdk:
1584-
continue-on-error: ${{ matrix.arch != 'amd64' }}
15851584
needs: [libxml2, curl, zlib, compilers, cmark_gfm, stdlib, macros]
15861585
runs-on: ${{ inputs.default_build_runner }}
15871586

@@ -1724,7 +1723,7 @@ jobs:
17241723
path: ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr
17251724

17261725
- name: cmark-gfm Setup
1727-
run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/
1726+
run: Copy-Item ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/
17281727

17291728
- uses: actions/checkout@v4
17301729
with:
@@ -1733,25 +1732,33 @@ jobs:
17331732
path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch
17341733
show-progress: false
17351734
- uses: actions/checkout@v4
1736-
if: matrix.os == 'Android'
1735+
if: matrix.os != 'Android'
17371736
with:
1738-
repository: hyp/swift-corelibs-foundation
1739-
ref: eng/recore-android-build
1737+
repository: apple/swift-corelibs-foundation
1738+
ref: ${{ inputs.swift_corelibs_foundation_revision }}
17401739
path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation
17411740
show-progress: false
17421741
- uses: actions/checkout@v4
1743-
if: matrix.os == 'Windows'
1742+
if: matrix.os == 'Android'
17441743
with:
1745-
repository: apple/swift-corelibs-foundation
1746-
ref: ${{ inputs.swift_corelibs_foundation_revision }}
1744+
repository: hyp/swift-corelibs-foundation
1745+
ref: eng/recore-android-build
17471746
path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation
17481747
show-progress: false
17491748
- uses: actions/checkout@v4
1749+
if: matrix.os != 'Android'
17501750
with:
17511751
repository: apple/swift-foundation
17521752
ref: ${{ inputs.swift_foundation_revision }}
17531753
path: ${{ github.workspace }}/SourceCache/swift-foundation
17541754
show-progress: false
1755+
- uses: actions/checkout@v4
1756+
if: matrix.os == 'Android'
1757+
with:
1758+
repository: hyp/swift-foundation
1759+
ref: android-wmo-merged
1760+
path: ${{ github.workspace }}/SourceCache/swift-foundation
1761+
show-progress: false
17551762
- uses: actions/checkout@v4
17561763
with:
17571764
repository: apple/swift-foundation-icu
@@ -1772,10 +1779,10 @@ jobs:
17721779
show-progress: false
17731780

17741781
- run: |
1775-
$RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin
1782+
$RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/bin
17761783
echo ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
17771784
1778-
$SDKRoot = cygpath -w ${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk
1785+
$SDKRoot = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk
17791786
echo "SDKROOT=${SDKRoot}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
17801787
17811788
# NOTE(compnerd): we execute unconditionally as we use CMake from VSDevEnv
@@ -1799,12 +1806,17 @@ jobs:
17991806
- name: Configure libdispatch
18001807
run: |
18011808
# Workaround CMake 3.20 issue
1802-
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
1803-
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
1809+
$CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
1810+
$SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
1811+
18041812
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
18051813
1806-
$WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1807-
$OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" }
1814+
$WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1815+
$OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") {
1816+
"-vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules"
1817+
} else {
1818+
""
1819+
}
18081820
18091821
$CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" }
18101822
@@ -1821,7 +1833,7 @@ jobs:
18211833
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr `
18221834
-D CMAKE_Swift_COMPILER=${SWIFTC} `
18231835
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} `
1824-
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" `
1836+
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" `
18251837
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
18261838
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
18271839
-D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} `
@@ -1842,17 +1854,23 @@ jobs:
18421854
- name: Configure Foundation
18431855
run: |
18441856
# Workaround CMake 3.20 issue
1845-
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
1846-
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
1847-
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
1848-
$WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1849-
$OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" }
1857+
$CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
1858+
$SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
1859+
18501860
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
1861+
1862+
$WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1863+
$OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") {
1864+
"-vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules"
1865+
} else {
1866+
""
1867+
}
1868+
18511869
$CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" }
1852-
$DEFINITION_FLAG = if ("${{ matrix.os }}" -eq "Windows") { "/D" } else { "-D" }
18531870
1854-
$zlib_lib = if ("${{ matrix.os }}" -eq "Windows") { "zlibstatic.lib" } else { "libz.a" }
1855-
$xml_lib = if ("${{ matrix.os }}" -eq "Windows") { "libxml2s.lib" } else { "libxml2.a" }
1871+
$DEFINITION_FLAG = if ("${{ matrix.os }}" -eq "Windows") { "/D" } else { "-D" }
1872+
$LIBZ = if ("${{ matrix.os }}" -eq "Windows") { "zlibstatic.lib" } else { "libz.a" }
1873+
$LIBXML = if ("${{ matrix.os }}" -eq "Windows") { "libxml2s.lib" } else { "libxml2.a" }
18561874
18571875
$SWIFT_FOUNDATION_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-foundation
18581876
$SWIFT_FOUNDATION_ICU_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-foundation-icu
@@ -1876,7 +1894,7 @@ jobs:
18761894
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr `
18771895
-D CMAKE_Swift_COMPILER=${SWIFTC} `
18781896
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} `
1879-
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" `
1897+
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" `
18801898
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
18811899
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
18821900
-D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} `
@@ -1898,9 +1916,9 @@ jobs:
18981916
-D _SwiftCollections_SourceDIR=$SWIFT_COLLECTIONS_SOURCE_DIR `
18991917
-D LIBXML2_DEFINITIONS="${DEFINITION_FLAG}LIBXML_STATIC" `
19001918
-D LIBXML2_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/include/libxml2 `
1901-
-D LIBXML2_LIBRARY=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/lib/$xml_lib `
1919+
-D LIBXML2_LIBRARY=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/lib/$LIBXML `
19021920
-D ZLIB_ROOT=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr `
1903-
-D ZLIB_LIBRARY=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr/lib/$zlib_lib
1921+
-D ZLIB_LIBRARY=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr/lib/$LIBZ
19041922
- name: Build foundation
19051923
run: |
19061924
cmake --build ${{ github.workspace }}/BinaryCache/foundation
@@ -1909,12 +1927,17 @@ jobs:
19091927
- name: Configure xctest
19101928
run: |
19111929
# Workaround CMake 3.20 issue
1912-
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
1913-
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
1930+
$CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
1931+
$SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
1932+
19141933
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
19151934
1916-
$WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1917-
$OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" }
1935+
$WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1936+
$OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") {
1937+
"-vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules"
1938+
} else {
1939+
""
1940+
}
19181941
19191942
$CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" }
19201943
@@ -1932,7 +1955,7 @@ jobs:
19321955
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr `
19331956
-D CMAKE_Swift_COMPILER=${SWIFTC} `
19341957
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} `
1935-
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" `
1958+
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" `
19361959
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
19371960
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
19381961
-D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} `

0 commit comments

Comments
 (0)