@@ -1775,38 +1775,37 @@ jobs:
1775
1775
searchPattern : ' **/*.dll'
1776
1776
1777
1777
macros :
1778
- # TODO: Build this on macOS or make an equivalent Mac-only job
1779
- if : inputs.build_os == 'Windows'
1780
1778
needs : [compilers, cmark_gfm, stdlib]
1781
1779
runs-on : ${{ inputs.default_build_runner }}
1782
1780
1783
1781
strategy :
1784
1782
fail-fast : false
1785
1783
matrix : ${{ fromJSON(inputs.host_matrix) }}
1786
1784
1787
- name : Windows ${{ matrix.arch }} Macros
1785
+ name : ${{ matrix.os }} ${{ matrix.arch }} Macros
1788
1786
1789
1787
steps :
1790
1788
- name : Download Compilers
1791
1789
uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1792
1790
with :
1793
- name : Windows -${{ inputs.build_arch }}-compilers
1791
+ name : ${{ inputs.build_os }} -${{ inputs.build_arch }}-compilers
1794
1792
path : ${{ github.workspace }}/BinaryCache/Library
1795
1793
- name : Download swift-syntax
1796
1794
uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1797
1795
with :
1798
- name : Windows -${{ matrix.arch }}-swift-syntax
1796
+ name : ${{ matrix.os }} -${{ matrix.arch }}-swift-syntax
1799
1797
path : ${{ github.workspace }}/BinaryCache/swift-syntax
1800
1798
- uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1801
1799
with :
1802
- name : Windows -${{ matrix.arch }}-stdlib
1800
+ name : ${{ matrix.os }} -${{ matrix.arch }}-stdlib
1803
1801
path : ${{ github.workspace }}/BinaryCache/Library
1804
1802
- uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1805
- if : matrix.arch == 'arm64'
1803
+ if : matrix.os == 'Windows' && matrix. arch == 'arm64'
1806
1804
with :
1807
- name : Windows-${{ inputs.build_arch }}-stdlib
1805
+ name : stdlib- Windows-${{ inputs.build_arch }}
1808
1806
path : ${{ github.workspace }}/BinaryCache/Library
1809
1807
- uses : actions/download-artifact@v4
1808
+ if : matrix.os == 'Windows'
1810
1809
with :
1811
1810
name : Windows-${{ matrix.arch }}-vfs-overlay
1812
1811
path : ${{ github.workspace }}/BinaryCache/swift/stdlib
@@ -1836,29 +1835,52 @@ jobs:
1836
1835
components : ' Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
1837
1836
arch : ${{ matrix.arch }}
1838
1837
1839
- - run : |
1840
- $RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/bin
1841
- echo ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1838
+ - uses : seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401
1839
+ if : inputs.build_os == 'Darwin'
1842
1840
1843
- - name : extract swift-syntax
1841
+ - name : Setup configuration
1842
+ id : setup-config
1844
1843
run : |
1844
+ $bindir = "${{ github.workspace }}/BinaryCache/swift-syntax"
1845
+ $SWIFTFLAGS = "${{ matrix.swiftflags }} -strict-implicit-module-context"
1846
+
1847
+ if ("${{ matrix.os }}" -eq "Windows") {
1848
+ $SWIFTC = cygpath -m "${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe"
1849
+ $bindir = cygpath -m $bindir
1850
+ $SDKRoot = "${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk"
1851
+ $SWIFTFLAGS += " -resource-dir ${SDKRoot}/usr/lib/swift"
1852
+ $SWIFTFLAGS += " -L${SDKRoot}/usr/lib/swift/windows"
1853
+
1854
+ # Export the path to the runtime libraries. This is only needed for Windows.
1855
+ $RTLPath = cygpath -w ${SDKRoot}/usr/bin
1856
+ Write-Output ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1857
+
1858
+ # VFS Overlay is only required on Windows.
1859
+ $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1860
+ $SWIFTFLAGS += " -vfsoverlay ${WINDOWS_VFS_OVERLAY}"
1861
+ $SWIFTFLAGS += " -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules"
1862
+ } else {
1863
+ $SWIFTC = "${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc"
1864
+ }
1865
+
1866
+ # Configure swift-syntax.
1845
1867
$module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake"
1846
- $bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax
1847
1868
(Get-Content $module).Replace('<BINARY_DIR>', "${bindir}") | Set-Content $module
1848
1869
1870
+ # Export the configuration.
1871
+ Write-Output "swiftc=${SWIFTC}" | Out-File -FilePath ${env:GITHUB_OUTPUT} -Encoding utf8 -Append
1872
+ Write-Output "swift-flags=${SWIFTFLAGS}" | Out-File -FilePath ${env:GITHUB_OUTPUT} -Encoding utf8 -Append
1873
+
1849
1874
- name : Configure Foundation Macros
1850
1875
run : |
1851
- $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1852
- $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe
1853
-
1854
1876
cmake -B ${{ github.workspace }}/BinaryCache/swift-foundation-macros `
1855
1877
-D CMAKE_BUILD_TYPE=Release `
1856
1878
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr `
1857
- -D CMAKE_Swift_COMPILER=${SWIFTC } `
1879
+ -D CMAKE_Swift_COMPILER=${{ steps.setup-config.outputs.swiftc } } `
1858
1880
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
1859
- -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 }}" `
1881
+ -D CMAKE_Swift_FLAGS="${{ steps.setup-config.outputs. swift-flags }}" `
1860
1882
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
1861
- -D CMAKE_SYSTEM_NAME=Windows `
1883
+ -D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
1862
1884
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
1863
1885
-G Ninja `
1864
1886
-S ${{ github.workspace }}/SourceCache/swift-foundation/Sources/FoundationMacros `
@@ -1868,16 +1890,13 @@ jobs:
1868
1890
1869
1891
- name : Configure Testing Macros
1870
1892
run : |
1871
- $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
1872
- $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe
1873
-
1874
1893
cmake -B ${{ github.workspace }}/BinaryCache/swift-testing-macros `
1875
1894
-D CMAKE_BUILD_TYPE=Release `
1876
1895
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr `
1877
- -D CMAKE_Swift_COMPILER=${SWIFTC } `
1896
+ -D CMAKE_Swift_COMPILER=${{ steps.setup-config.outputs.swiftc } } `
1878
1897
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
1879
- -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 }}" `
1880
- -D CMAKE_SYSTEM_NAME=Windows `
1898
+ -D CMAKE_Swift_FLAGS="${{ steps.setup-config.outputs. swift-flags }}" `
1899
+ -D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
1881
1900
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
1882
1901
-G Ninja `
1883
1902
-S ${{ github.workspace }}/SourceCache/swift-testing/Sources/TestingMacros `
@@ -1891,14 +1910,14 @@ jobs:
1891
1910
run : cmake --build ${{ github.workspace }}/BinaryCache/swift-testing-macros --target install
1892
1911
1893
1912
- name : Upload macros
1894
- uses : actions/ upload-artifact@v4
1913
+ uses : thebrowsercompany/gha- upload-tar- artifact@e18c33b1cd416d0d96a91dc6dce06219f98e4e27 # main
1895
1914
with :
1896
1915
name : ${{ matrix.os }}-${{ matrix.arch }}-macros
1897
1916
path : ${{ github.workspace }}/BuildRoot/Library
1898
1917
1899
1918
- name : Upload PDBs to Azure
1900
1919
1901
- if : ${{ inputs.debug_info }}
1920
+ if : ${{ inputs.debug_info && matrix.os == 'Windows' }}
1902
1921
with :
1903
1922
accountName : ${{ vars.SYMBOL_SERVER_ACCOUNT }}
1904
1923
personalAccessToken : ${{ secrets.SYMBOL_SERVER_PAT }}
@@ -1907,7 +1926,7 @@ jobs:
1907
1926
1908
1927
- name : Upload DLLs to Azure
1909
1928
1910
- if : ${{ inputs.debug_info }}
1929
+ if : ${{ inputs.debug_info && matrix.os == 'Windows' }}
1911
1930
with :
1912
1931
accountName : ${{ vars.SYMBOL_SERVER_ACCOUNT }}
1913
1932
personalAccessToken : ${{ secrets.SYMBOL_SERVER_PAT }}
@@ -2525,7 +2544,7 @@ jobs:
2525
2544
with :
2526
2545
name : Windows-${{ matrix.arch }}-sdk
2527
2546
path : ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
2528
- - uses : actions/ download-artifact@v4
2547
+ - uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
2529
2548
with :
2530
2549
name : Windows-${{ inputs.build_arch }}-macros
2531
2550
path : ${{ github.workspace }}/BinaryCache/Library
@@ -3341,7 +3360,7 @@ jobs:
3341
3360
path : ${{ github.workspace }}/BuildRoot/Library
3342
3361
3343
3362
- name : Download Macros
3344
- uses : actions/ download-artifact@v4
3363
+ uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
3345
3364
with :
3346
3365
name : Windows-${{ matrix.arch }}-macros
3347
3366
path : ${{ github.workspace }}/BuildRoot/Library
@@ -3626,7 +3645,7 @@ jobs:
3626
3645
triple_no_api_level : x86_64-unknown-linux-android
3627
3646
3628
3647
steps :
3629
- - uses : actions/ download-artifact@v4
3648
+ - uses : thebrowsercompany/gha- download-tar- artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
3630
3649
# There is currently no Android NDK for Windows ARM64 so build Android only on Windows X64 host only
3631
3650
if : inputs.build_android
3632
3651
with :
0 commit comments