@@ -1872,38 +1872,37 @@ jobs:
1872
1872
searchPattern : ' **/*.dll'
1873
1873
1874
1874
macros :
1875
- # TODO: Build this on macOS or make an equivalent Mac-only job
1876
- if : inputs.build_os == 'Windows'
1877
1875
needs : [compilers, cmark_gfm, stdlib]
1878
1876
runs-on : ${{ inputs.default_build_runner }}
1879
1877
1880
1878
strategy :
1881
1879
fail-fast : false
1882
1880
matrix : ${{ fromJSON(inputs.host_matrix) }}
1883
1881
1884
- name : Windows ${{ matrix.arch }} Macros
1882
+ name : ${{ matrix.os }} ${{ matrix.arch }} Macros
1885
1883
1886
1884
steps :
1887
1885
- name : Download Compilers
1888
1886
uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1889
1887
with :
1890
- name : Windows -${{ inputs.build_arch }}-Asserts-compilers
1888
+ name : ${{ inputs.build_os }} -${{ inputs.build_arch }}-Asserts-compilers
1891
1889
path : ${{ github.workspace }}/BinaryCache/Library
1892
1890
- name : Download swift-syntax
1893
1891
uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1894
1892
with :
1895
- name : Windows -${{ matrix.arch }}-Asserts-swift-syntax
1893
+ name : ${{ matrix.os }} -${{ matrix.arch }}-Asserts-swift-syntax
1896
1894
path : ${{ github.workspace }}/BinaryCache/swift-syntax
1897
1895
- uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1898
1896
with :
1899
- name : Windows -${{ matrix.arch }}-stdlib
1897
+ name : ${{ matrix.os }} -${{ matrix.arch }}-stdlib
1900
1898
path : ${{ github.workspace }}/BinaryCache/Library
1901
1899
- uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1902
- if : matrix.arch == 'arm64'
1900
+ if : matrix.os == 'Windows' && matrix. arch == 'arm64'
1903
1901
with :
1904
1902
name : Windows-${{ inputs.build_arch }}-stdlib
1905
1903
path : ${{ github.workspace }}/BinaryCache/Library
1906
1904
- uses : actions/download-artifact@v4
1905
+ if : matrix.os == 'Windows'
1907
1906
with :
1908
1907
name : Windows-${{ matrix.arch }}-vfs-overlay
1909
1908
path : ${{ github.workspace }}/BinaryCache/swift/stdlib
@@ -1934,29 +1933,52 @@ jobs:
1934
1933
arch : ${{ matrix.arch }}
1935
1934
winsdk : ${{ env.WORKAROUND_WINDOWS_SDK_VERSION }}
1936
1935
1937
- - run : |
1938
- $RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/bin
1939
- echo ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1936
+ - uses : seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401
1937
+ if : inputs.build_os == 'Darwin'
1940
1938
1941
- - name : extract swift-syntax
1939
+ - name : Setup configuration
1940
+ id : setup-config
1942
1941
run : |
1942
+ $bindir = "${{ github.workspace }}/BinaryCache/swift-syntax"
1943
+ $SWIFTFLAGS = "${{ matrix.swiftflags }} -strict-implicit-module-context"
1944
+
1945
+ if ("${{ matrix.os }}" -eq "Windows") {
1946
+ $SWIFTC = cygpath -m "${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe"
1947
+ $bindir = cygpath -m $bindir
1948
+ $SDKRoot = "${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk"
1949
+ $SWIFTFLAGS += " -resource-dir ${SDKRoot}/usr/lib/swift"
1950
+ $SWIFTFLAGS += " -L${SDKRoot}/usr/lib/swift/windows"
1951
+
1952
+ # Export the path to the runtime libraries. This is only needed for Windows.
1953
+ $RTLPath = cygpath -w ${SDKRoot}/usr/bin
1954
+ Write-Output ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1955
+
1956
+ # VFS Overlay is only required on Windows.
1957
+ $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1958
+ $SWIFTFLAGS += " -vfsoverlay ${WINDOWS_VFS_OVERLAY}"
1959
+ $SWIFTFLAGS += " -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules"
1960
+ } else {
1961
+ $SWIFTC = "${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc"
1962
+ }
1963
+
1964
+ # Configure swift-syntax.
1943
1965
$module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake"
1944
- $bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax
1945
1966
(Get-Content $module).Replace('<BINARY_DIR>', "${bindir}") | Set-Content $module
1946
1967
1968
+ # Export the configuration.
1969
+ Write-Output "swiftc=${SWIFTC}" | Out-File -FilePath ${env:GITHUB_OUTPUT} -Encoding utf8 -Append
1970
+ Write-Output "swift-flags=${SWIFTFLAGS}" | Out-File -FilePath ${env:GITHUB_OUTPUT} -Encoding utf8 -Append
1971
+
1947
1972
- name : Configure Foundation Macros
1948
1973
run : |
1949
- $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1950
- $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe
1951
-
1952
1974
cmake -B ${{ github.workspace }}/BinaryCache/swift-foundation-macros `
1953
1975
-D CMAKE_BUILD_TYPE=Release `
1954
1976
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr `
1955
- -D CMAKE_Swift_COMPILER=${SWIFTC } `
1977
+ -D CMAKE_Swift_COMPILER=${{ steps.setup-config.outputs.swiftc } } `
1956
1978
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
1957
- -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 }}" `
1979
+ -D CMAKE_Swift_FLAGS="${{ steps.setup-config.outputs. swift-flags }}" `
1958
1980
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
1959
- -D CMAKE_SYSTEM_NAME=Windows `
1981
+ -D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
1960
1982
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
1961
1983
-G Ninja `
1962
1984
-S ${{ github.workspace }}/SourceCache/swift-foundation/Sources/FoundationMacros `
@@ -1966,16 +1988,13 @@ jobs:
1966
1988
1967
1989
- name : Configure Testing Macros
1968
1990
run : |
1969
- $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1970
- $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe
1971
-
1972
1991
cmake -B ${{ github.workspace }}/BinaryCache/swift-testing-macros `
1973
1992
-D CMAKE_BUILD_TYPE=Release `
1974
1993
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr `
1975
- -D CMAKE_Swift_COMPILER=${SWIFTC } `
1994
+ -D CMAKE_Swift_COMPILER=${{ steps.setup-config.outputs.swiftc } } `
1976
1995
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
1977
- -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 }}" `
1978
- -D CMAKE_SYSTEM_NAME=Windows `
1996
+ -D CMAKE_Swift_FLAGS="${{ steps.setup-config.outputs. swift-flags }}" `
1997
+ -D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
1979
1998
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
1980
1999
-G Ninja `
1981
2000
-S ${{ github.workspace }}/SourceCache/swift-testing/Sources/TestingMacros `
@@ -1989,14 +2008,14 @@ jobs:
1989
2008
run : cmake --build ${{ github.workspace }}/BinaryCache/swift-testing-macros --target install
1990
2009
1991
2010
- name : Upload macros
1992
- uses : actions/ upload-artifact@v4
2011
+ uses : thebrowsercompany/gha- upload-tar- artifact@e18c33b1cd416d0d96a91dc6dce06219f98e4e27 # main
1993
2012
with :
1994
2013
name : ${{ matrix.os }}-${{ matrix.arch }}-macros
1995
2014
path : ${{ github.workspace }}/BuildRoot/Library
1996
2015
1997
2016
- name : Upload PDBs to Azure
1998
2017
1999
- if : ${{ inputs.debug_info }}
2018
+ if : ${{ inputs.debug_info && matrix.os == 'Windows' }}
2000
2019
with :
2001
2020
accountName : ${{ vars.SYMBOL_SERVER_ACCOUNT }}
2002
2021
personalAccessToken : ${{ secrets.SYMBOL_SERVER_PAT }}
@@ -2005,7 +2024,7 @@ jobs:
2005
2024
2006
2025
- name : Upload DLLs to Azure
2007
2026
2008
- if : ${{ inputs.debug_info }}
2027
+ if : ${{ inputs.debug_info && matrix.os == 'Windows' }}
2009
2028
with :
2010
2029
accountName : ${{ vars.SYMBOL_SERVER_ACCOUNT }}
2011
2030
personalAccessToken : ${{ secrets.SYMBOL_SERVER_PAT }}
@@ -2640,7 +2659,7 @@ jobs:
2640
2659
with :
2641
2660
name : Windows-${{ matrix.arch }}-sdk
2642
2661
path : ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
2643
- - uses : actions/ download-artifact@v4
2662
+ - uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
2644
2663
with :
2645
2664
name : Windows-${{ inputs.build_arch }}-macros
2646
2665
path : ${{ github.workspace }}/BinaryCache/Library
@@ -3514,7 +3533,7 @@ jobs:
3514
3533
path : ${{ github.workspace }}/BuildRoot/Library
3515
3534
3516
3535
- name : Download Macros
3517
- uses : actions/ download-artifact@v4
3536
+ uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
3518
3537
with :
3519
3538
name : Windows-${{ matrix.arch }}-macros
3520
3539
path : ${{ github.workspace }}/BuildRoot/Library
0 commit comments