@@ -1908,34 +1908,32 @@ jobs:
1908
1908
searchPattern : ' **/*.dll'
1909
1909
1910
1910
macros :
1911
- # TODO: Build this on macOS or make an equivalent Mac-only job
1912
- if : inputs.build_os == 'Windows'
1913
1911
needs : [compilers, cmark_gfm, stdlib]
1914
1912
runs-on : ${{ inputs.default_build_runner }}
1915
1913
1916
1914
strategy :
1917
1915
fail-fast : false
1918
1916
matrix : ${{ fromJSON(inputs.host_matrix) }}
1919
1917
1920
- name : Windows ${{ matrix.arch }} Macros
1918
+ name : ${{ matrix.os }} ${{ matrix.arch }} Macros
1921
1919
1922
1920
steps :
1923
1921
- name : Download Compilers
1924
1922
uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1925
1923
with :
1926
- name : Windows -${{ inputs.build_arch }}-Asserts-compilers
1924
+ name : ${{ inputs.build_os }} -${{ inputs.build_arch }}-Asserts-compilers
1927
1925
path : ${{ github.workspace }}/BinaryCache/Library
1928
1926
- name : Download swift-syntax
1929
1927
uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1930
1928
with :
1931
- name : Windows -${{ matrix.arch }}-Asserts-swift-syntax
1929
+ name : ${{ matrix.os }} -${{ matrix.arch }}-Asserts-swift-syntax
1932
1930
path : ${{ github.workspace }}/BinaryCache/swift-syntax
1933
1931
- uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1934
1932
with :
1935
- name : Windows -${{ matrix.arch }}-stdlib
1933
+ name : ${{ matrix.os }} -${{ matrix.arch }}-stdlib
1936
1934
path : ${{ github.workspace }}/BinaryCache/Library
1937
1935
- uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1938
- if : matrix.arch == 'arm64'
1936
+ if : matrix.os == 'Windows' && matrix. arch == 'arm64'
1939
1937
with :
1940
1938
name : Windows-${{ inputs.build_arch }}-stdlib
1941
1939
path : ${{ github.workspace }}/BinaryCache/Library
@@ -1966,17 +1964,44 @@ jobs:
1966
1964
arch : ${{ matrix.arch }}
1967
1965
winsdk : ${{ env.WORKAROUND_WINDOWS_SDK_VERSION }}
1968
1966
1969
- - run : |
1970
- $RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/bin
1971
- echo ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1967
+ - uses : seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401
1968
+ if : inputs.build_os == 'Darwin'
1972
1969
1973
- - name : Extract swift-syntax
1970
+ - name : Setup configuration
1971
+ id : setup-config
1974
1972
run : |
1973
+ $bindir = "${{ github.workspace }}/BinaryCache/swift-syntax"
1974
+ $SWIFTFLAGS = "${{ matrix.swiftflags }} -strict-implicit-module-context"
1975
+
1976
+ if ("${{ matrix.os }}" -eq "Windows") {
1977
+ $SWIFTC = cygpath -m "${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe"
1978
+ $bindir = cygpath -m $bindir
1979
+ $SDKRoot = "${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk"
1980
+ $SWIFTFLAGS += " -resource-dir ${SDKRoot}/usr/lib/swift"
1981
+ $SWIFTFLAGS += " -L${SDKRoot}/usr/lib/swift/windows"
1982
+
1983
+ # Export the path to the runtime libraries. This is only needed for Windows.
1984
+ $RTLPath = cygpath -w ${SDKRoot}/usr/bin
1985
+ Write-Output ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1986
+
1987
+ # VFS Overlay is only required on Windows.
1988
+ $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1989
+ $SWIFTFLAGS += " -vfsoverlay ${WINDOWS_VFS_OVERLAY}"
1990
+ $SWIFTFLAGS += " -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules"
1991
+ } else {
1992
+ $SWIFTC = "${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc"
1993
+ }
1994
+
1995
+ # Configure swift-syntax.
1975
1996
$module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake"
1976
- $bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax
1977
1997
(Get-Content $module).Replace('<BINARY_DIR>', "${bindir}") | Set-Content $module
1978
1998
1999
+ # Export the configuration.
2000
+ Write-Output "swiftc=${SWIFTC}" | Out-File -FilePath ${env:GITHUB_OUTPUT} -Encoding utf8 -Append
2001
+ Write-Output "swift-flags=${SWIFTFLAGS}" | Out-File -FilePath ${env:GITHUB_OUTPUT} -Encoding utf8 -Append
2002
+
1979
2003
- name : Create vfs-overlay
2004
+ if : matrix.os == 'Windows'
1980
2005
run : |
1981
2006
$VfsOverlay = "${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml"
1982
2007
$ModuleMapDir = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/share
@@ -2022,17 +2047,14 @@ jobs:
2022
2047
2023
2048
- name : Configure Foundation Macros
2024
2049
run : |
2025
- $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
2026
- $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe
2027
-
2028
2050
cmake -B ${{ github.workspace }}/BinaryCache/swift-foundation-macros `
2029
2051
-D CMAKE_BUILD_TYPE=Release `
2030
2052
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr `
2031
- -D CMAKE_Swift_COMPILER=${SWIFTC } `
2053
+ -D CMAKE_Swift_COMPILER=${{ steps.setup-config.outputs.swiftc } } `
2032
2054
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
2033
- -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/ swift/windows -vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules ${{ inputs.CMAKE_Swift_FLAGS }}" `
2055
+ -D CMAKE_Swift_FLAGS="${{ steps.setup-config.outputs. swift-flags }}" `
2034
2056
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
2035
- -D CMAKE_SYSTEM_NAME=Windows `
2057
+ -D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
2036
2058
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
2037
2059
-G Ninja `
2038
2060
-S ${{ github.workspace }}/SourceCache/swift-foundation/Sources/FoundationMacros `
@@ -2042,16 +2064,13 @@ jobs:
2042
2064
2043
2065
- name : Configure Testing Macros
2044
2066
run : |
2045
- $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
2046
- $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe
2047
-
2048
2067
cmake -B ${{ github.workspace }}/BinaryCache/swift-testing-macros `
2049
2068
-D CMAKE_BUILD_TYPE=Release `
2050
2069
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr `
2051
- -D CMAKE_Swift_COMPILER=${SWIFTC } `
2070
+ -D CMAKE_Swift_COMPILER=${{ steps.setup-config.outputs.swiftc } } `
2052
2071
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
2053
- -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/ swift/windows -vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules ${{ inputs.CMAKE_Swift_FLAGS }}" `
2054
- -D CMAKE_SYSTEM_NAME=Windows `
2072
+ -D CMAKE_Swift_FLAGS="${{ steps.setup-config.outputs. swift-flags }}" `
2073
+ -D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
2055
2074
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
2056
2075
-G Ninja `
2057
2076
-S ${{ github.workspace }}/SourceCache/swift-testing/Sources/TestingMacros `
@@ -2065,14 +2084,14 @@ jobs:
2065
2084
run : cmake --build ${{ github.workspace }}/BinaryCache/swift-testing-macros --target install
2066
2085
2067
2086
- name : Upload macros
2068
- uses : actions/ upload-artifact@v4
2087
+ uses : thebrowsercompany/gha- upload-tar- artifact@e18c33b1cd416d0d96a91dc6dce06219f98e4e27 # main
2069
2088
with :
2070
2089
name : ${{ matrix.os }}-${{ matrix.arch }}-macros
2071
2090
path : ${{ github.workspace }}/BuildRoot/Library
2072
2091
2073
2092
- name : Upload PDBs to Azure
2074
2093
uses : microsoft/action-publish-symbols@v2.1.6
2075
- if : ${{ inputs.debug_info }}
2094
+ if : ${{ inputs.debug_info && matrix.os == 'Windows' }}
2076
2095
with :
2077
2096
accountName : ${{ vars.SYMBOL_SERVER_ACCOUNT }}
2078
2097
personalAccessToken : ${{ secrets.SYMBOL_SERVER_PAT }}
@@ -2081,7 +2100,7 @@ jobs:
2081
2100
2082
2101
- name : Upload DLLs to Azure
2083
2102
uses : microsoft/action-publish-symbols@v2.1.6
2084
- if : ${{ inputs.debug_info }}
2103
+ if : ${{ inputs.debug_info && matrix.os == 'Windows' }}
2085
2104
with :
2086
2105
accountName : ${{ vars.SYMBOL_SERVER_ACCOUNT }}
2087
2106
personalAccessToken : ${{ secrets.SYMBOL_SERVER_PAT }}
@@ -2224,7 +2243,7 @@ jobs:
2224
2243
with :
2225
2244
name : Windows-${{ inputs.build_arch }}-stdlib
2226
2245
path : ${{ github.workspace }}/BinaryCache/Library
2227
- - uses : actions/ download-artifact@v4
2246
+ - uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
2228
2247
if : matrix.os != 'Android' || inputs.build_android
2229
2248
with :
2230
2249
name : Windows-${{ inputs.build_arch }}-macros
@@ -2786,7 +2805,7 @@ jobs:
2786
2805
with :
2787
2806
name : Windows-${{ matrix.arch }}-sdk
2788
2807
path : ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
2789
- - uses : actions/ download-artifact@v4
2808
+ - uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
2790
2809
with :
2791
2810
name : Windows-${{ inputs.build_arch }}-macros
2792
2811
path : ${{ github.workspace }}/BinaryCache/Library
@@ -3660,7 +3679,7 @@ jobs:
3660
3679
path : ${{ github.workspace }}/BuildRoot/Library
3661
3680
3662
3681
- name : Download Macros
3663
- uses : actions/ download-artifact@v4
3682
+ uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
3664
3683
with :
3665
3684
name : Windows-${{ matrix.arch }}-macros
3666
3685
path : ${{ github.workspace }}/BuildRoot/Library
0 commit comments