@@ -1908,34 +1908,32 @@ jobs:
19081908 searchPattern : ' **/*.dll'
19091909
19101910 macros :
1911- # TODO: Build this on macOS or make an equivalent Mac-only job
1912- if : inputs.build_os == 'Windows'
19131911 needs : [compilers, cmark_gfm, stdlib]
19141912 runs-on : ${{ inputs.default_build_runner }}
19151913
19161914 strategy :
19171915 fail-fast : false
19181916 matrix : ${{ fromJSON(inputs.host_matrix) }}
19191917
1920- name : Windows ${{ matrix.arch }} Macros
1918+ name : ${{ matrix.os }} ${{ matrix.arch }} Macros
19211919
19221920 steps :
19231921 - name : Download Compilers
19241922 uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
19251923 with :
1926- name : Windows -${{ inputs.build_arch }}-Asserts-compilers
1924+ name : ${{ inputs.build_os }} -${{ inputs.build_arch }}-Asserts-compilers
19271925 path : ${{ github.workspace }}/BinaryCache/Library
19281926 - name : Download swift-syntax
19291927 uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
19301928 with :
1931- name : Windows -${{ matrix.arch }}-Asserts-swift-syntax
1929+ name : ${{ matrix.os }} -${{ matrix.arch }}-Asserts-swift-syntax
19321930 path : ${{ github.workspace }}/BinaryCache/swift-syntax
19331931 - uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
19341932 with :
1935- name : Windows -${{ matrix.arch }}-stdlib
1933+ name : ${{ matrix.os }} -${{ matrix.arch }}-stdlib
19361934 path : ${{ github.workspace }}/BinaryCache/Library
19371935 - uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1938- if : matrix.arch == 'arm64'
1936+ if : matrix.os == 'Windows' && matrix. arch == 'arm64'
19391937 with :
19401938 name : Windows-${{ inputs.build_arch }}-stdlib
19411939 path : ${{ github.workspace }}/BinaryCache/Library
@@ -1966,17 +1964,44 @@ jobs:
19661964 arch : ${{ matrix.arch }}
19671965 winsdk : ${{ env.WORKAROUND_WINDOWS_SDK_VERSION }}
19681966
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'
19721969
1973- - name : Extract swift-syntax
1970+ - name : Setup configuration
1971+ id : setup-config
19741972 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.
19751996 $module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake"
1976- $bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax
19771997 (Get-Content $module).Replace('<BINARY_DIR>', "${bindir}") | Set-Content $module
19781998
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+
19792003 - name : Create vfs-overlay
2004+ if : matrix.os == 'Windows'
19802005 run : |
19812006 $VfsOverlay = "${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml"
19822007 $ModuleMapDir = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/share
@@ -2022,17 +2047,14 @@ jobs:
20222047
20232048 - name : Configure Foundation Macros
20242049 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-
20282050 cmake -B ${{ github.workspace }}/BinaryCache/swift-foundation-macros `
20292051 -D CMAKE_BUILD_TYPE=Release `
20302052 -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 } } `
20322054 -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 }}" `
20342056 -D CMAKE_Swift_FLAGS_RELEASE="-O" `
2035- -D CMAKE_SYSTEM_NAME=Windows `
2057+ -D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
20362058 -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
20372059 -G Ninja `
20382060 -S ${{ github.workspace }}/SourceCache/swift-foundation/Sources/FoundationMacros `
@@ -2042,16 +2064,13 @@ jobs:
20422064
20432065 - name : Configure Testing Macros
20442066 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-
20482067 cmake -B ${{ github.workspace }}/BinaryCache/swift-testing-macros `
20492068 -D CMAKE_BUILD_TYPE=Release `
20502069 -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 } } `
20522071 -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 }} `
20552074 -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
20562075 -G Ninja `
20572076 -S ${{ github.workspace }}/SourceCache/swift-testing/Sources/TestingMacros `
@@ -2065,14 +2084,14 @@ jobs:
20652084 run : cmake --build ${{ github.workspace }}/BinaryCache/swift-testing-macros --target install
20662085
20672086 - name : Upload macros
2068- uses : actions/ upload-artifact@v4
2087+ uses : thebrowsercompany/gha- upload-tar- artifact@e18c33b1cd416d0d96a91dc6dce06219f98e4e27 # main
20692088 with :
20702089 name : ${{ matrix.os }}-${{ matrix.arch }}-macros
20712090 path : ${{ github.workspace }}/BuildRoot/Library
20722091
20732092 - name : Upload PDBs to Azure
207420932075- if : ${{ inputs.debug_info }}
2094+ if : ${{ inputs.debug_info && matrix.os == 'Windows' }}
20762095 with :
20772096 accountName : ${{ vars.SYMBOL_SERVER_ACCOUNT }}
20782097 personalAccessToken : ${{ secrets.SYMBOL_SERVER_PAT }}
@@ -2081,7 +2100,7 @@ jobs:
20812100
20822101 - name : Upload DLLs to Azure
208321022084- if : ${{ inputs.debug_info }}
2103+ if : ${{ inputs.debug_info && matrix.os == 'Windows' }}
20852104 with :
20862105 accountName : ${{ vars.SYMBOL_SERVER_ACCOUNT }}
20872106 personalAccessToken : ${{ secrets.SYMBOL_SERVER_PAT }}
@@ -2224,7 +2243,7 @@ jobs:
22242243 with :
22252244 name : Windows-${{ inputs.build_arch }}-stdlib
22262245 path : ${{ github.workspace }}/BinaryCache/Library
2227- - uses : actions/ download-artifact@v4
2246+ - uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
22282247 if : matrix.os != 'Android' || inputs.build_android
22292248 with :
22302249 name : Windows-${{ inputs.build_arch }}-macros
@@ -2757,7 +2776,7 @@ jobs:
27572776 with :
27582777 name : Windows-${{ matrix.arch }}-sdk
27592778 path : ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
2760- - uses : actions/ download-artifact@v4
2779+ - uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
27612780 with :
27622781 name : Windows-${{ inputs.build_arch }}-macros
27632782 path : ${{ github.workspace }}/BinaryCache/Library
@@ -3631,7 +3650,7 @@ jobs:
36313650 path : ${{ github.workspace }}/BuildRoot/Library
36323651
36333652 - name : Download Macros
3634- uses : actions/ download-artifact@v4
3653+ uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
36353654 with :
36363655 name : Windows-${{ matrix.arch }}-macros
36373656 path : ${{ github.workspace }}/BuildRoot/Library
0 commit comments