Skip to content

Commit 6ba7e5f

Browse files
authored
Fix devtools stage (#815)
* build with explicit -sdk passed into Swift * The SDKROOT environment variable isn't enough when using the old driver * checkout latest swift testing * pass c++ flags and c++ compiler for the markdown build * download devtools host sdk after the target libs are setup correctly * fix cmark path * debugging tools: download stdlib as well
1 parent 3f2b15d commit 6ba7e5f

File tree

1 file changed

+39
-33
lines changed

1 file changed

+39
-33
lines changed

.github/workflows/swift-toolchain.yml

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,19 +1893,11 @@ jobs:
18931893
path: ${{ github.workspace }}/SourceCache/swift-corelibs-xctest
18941894
show-progress: false
18951895
- uses: actions/checkout@v4
1896-
if: matrix.os != 'Android'
18971896
with:
18981897
repository: swiftlang/swift-testing
18991898
ref: ${{ inputs.swift_testing_revision }}
19001899
path: ${{ github.workspace }}/SourceCache/swift-testing
19011900
show-progress: false
1902-
- uses: actions/checkout@v4
1903-
if: matrix.os == 'Android'
1904-
with:
1905-
repository: swiftlang/swift-testing
1906-
ref: main-next
1907-
path: ${{ github.workspace }}/SourceCache/swift-testing
1908-
show-progress: false
19091901

19101902
- run: |
19111903
$RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/bin
@@ -2234,18 +2226,10 @@ jobs:
22342226
with:
22352227
name: Windows-stdlib-${{ matrix.arch }}
22362228
path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
2237-
- uses: actions/download-artifact@v4
2238-
with:
2239-
name: Windows-stdlib-amd64
2240-
path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
22412229
- uses: actions/download-artifact@v4
22422230
with:
22432231
name: Windows-sdk-${{ matrix.arch }}
22442232
path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
2245-
- uses: actions/download-artifact@v4
2246-
with:
2247-
name: Windows-sdk-amd64
2248-
path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
22492233
- uses: actions/download-artifact@v4
22502234
with:
22512235
name: macros-amd64
@@ -2266,7 +2250,7 @@ jobs:
22662250
if: matrix.arch == 'arm64'
22672251
with:
22682252
name: cmark-gfm-arm64-0.29.0.gfm.13
2269-
path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr
2253+
path: ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr
22702254

22712255
- uses: actions/checkout@v4
22722256
with:
@@ -2395,6 +2379,16 @@ jobs:
23952379
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
23962380
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
23972381
2382+
# Download host libraries for the windows amd64 host, after moving the target libraries to the target-specific directory.
2383+
- uses: actions/download-artifact@v4
2384+
with:
2385+
name: Windows-stdlib-amd64
2386+
path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
2387+
- uses: actions/download-artifact@v4
2388+
with:
2389+
name: Windows-sdk-amd64
2390+
path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform
2391+
23982392
- name: Configure swift-argument-parser
23992393
run: |
24002394
# Workaround CMake 3.20 issue
@@ -2416,7 +2410,7 @@ jobs:
24162410
-D CMAKE_Swift_COMPILER=${SWIFTC} `
24172411
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
24182412
-D CMAKE_Swift_COMPILER_WORKS=YES `
2419-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2413+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
24202414
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
24212415
-D CMAKE_SYSTEM_NAME=Windows `
24222416
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2446,7 +2440,7 @@ jobs:
24462440
-D CMAKE_Swift_COMPILER=${SWIFTC} `
24472441
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
24482442
-D CMAKE_Swift_COMPILER_WORKS=YES `
2449-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2443+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
24502444
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
24512445
-D CMAKE_SYSTEM_NAME=Windows `
24522446
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2475,7 +2469,7 @@ jobs:
24752469
-D CMAKE_Swift_COMPILER=${SWIFTC} `
24762470
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
24772471
-D CMAKE_Swift_COMPILER_WORKS=YES `
2478-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2472+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
24792473
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
24802474
-D CMAKE_SYSTEM_NAME=Windows `
24812475
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2504,7 +2498,7 @@ jobs:
25042498
-D CMAKE_Swift_COMPILER=${SWIFTC} `
25052499
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
25062500
-D CMAKE_Swift_COMPILER_WORKS=YES `
2507-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2501+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
25082502
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
25092503
-D CMAKE_SYSTEM_NAME=Windows `
25102504
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2533,7 +2527,7 @@ jobs:
25332527
-D CMAKE_Swift_COMPILER=${SWIFTC} `
25342528
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
25352529
-D CMAKE_Swift_COMPILER_WORKS=YES `
2536-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2530+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
25372531
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
25382532
-D CMAKE_SYSTEM_NAME=Windows `
25392533
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2566,7 +2560,7 @@ jobs:
25662560
-D CMAKE_Swift_COMPILER=${SWIFTC} `
25672561
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
25682562
-D CMAKE_Swift_COMPILER_WORKS=YES `
2569-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2563+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
25702564
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
25712565
-D CMAKE_SYSTEM_NAME=Windows `
25722566
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2596,7 +2590,7 @@ jobs:
25962590
-D CMAKE_Swift_COMPILER=${SWIFTC} `
25972591
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
25982592
-D CMAKE_Swift_COMPILER_WORKS=YES `
2599-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2593+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
26002594
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
26012595
-D CMAKE_SYSTEM_NAME=Windows `
26022596
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2629,7 +2623,7 @@ jobs:
26292623
-D CMAKE_Swift_COMPILER=${SWIFTC} `
26302624
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
26312625
-D CMAKE_Swift_COMPILER_WORKS=YES `
2632-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2626+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
26332627
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
26342628
-D CMAKE_SYSTEM_NAME=Windows `
26352629
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2657,7 +2651,7 @@ jobs:
26572651
-D CMAKE_Swift_COMPILER=${SWIFTC} `
26582652
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
26592653
-D CMAKE_Swift_COMPILER_WORKS=YES `
2660-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2654+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
26612655
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
26622656
-D CMAKE_SYSTEM_NAME=Windows `
26632657
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2678,7 +2672,7 @@ jobs:
26782672
-D CMAKE_Swift_COMPILER=${SWIFTC} `
26792673
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
26802674
-D CMAKE_Swift_COMPILER_WORKS=YES `
2681-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2675+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
26822676
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
26832677
-D CMAKE_SYSTEM_NAME=Windows `
26842678
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2716,7 +2710,7 @@ jobs:
27162710
-D CMAKE_Swift_COMPILER=${SWIFTC} `
27172711
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
27182712
-D CMAKE_Swift_COMPILER_WORKS=YES `
2719-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2713+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
27202714
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
27212715
-D CMAKE_SYSTEM_NAME=Windows `
27222716
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2751,17 +2745,20 @@ jobs:
27512745
-D CMAKE_C_COMPILER=${CLANG_CL} `
27522746
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
27532747
-D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" `
2748+
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
2749+
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
2750+
-D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
27542751
-D CMAKE_Swift_COMPILER=${SWIFTC} `
27552752
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
27562753
-D CMAKE_Swift_COMPILER_WORKS=YES `
2757-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2754+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
27582755
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
27592756
-D CMAKE_SYSTEM_NAME=Windows `
27602757
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
27612758
-G Ninja `
27622759
-S ${{ github.workspace }}/SourceCache/swift-markdown `
27632760
-D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules `
2764-
-D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake
2761+
-D cmark-gfm_DIR=${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake
27652762
- name: Build Markdown
27662763
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-markdown
27672764

@@ -2781,7 +2778,7 @@ jobs:
27812778
-D CMAKE_Swift_COMPILER=${SWIFTC} `
27822779
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
27832780
-D CMAKE_Swift_COMPILER_WORKS=YES `
2784-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2781+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
27852782
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
27862783
-D CMAKE_SYSTEM_NAME=Windows `
27872784
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2815,7 +2812,7 @@ jobs:
28152812
-D CMAKE_Swift_COMPILER=${SWIFTC} `
28162813
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
28172814
-D CMAKE_Swift_COMPILER_WORKS=YES `
2818-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2815+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
28192816
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
28202817
-D CMAKE_SYSTEM_NAME=Windows `
28212818
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2845,7 +2842,7 @@ jobs:
28452842
-D CMAKE_Swift_COMPILER=${SWIFTC} `
28462843
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
28472844
-D CMAKE_Swift_COMPILER_WORKS=YES `
2848-
-D CMAKE_Swift_FLAGS="${{ inputs.CMAKE_Swift_FLAGS }}" `
2845+
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
28492846
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
28502847
-D CMAKE_SYSTEM_NAME=Windows `
28512848
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
@@ -2942,6 +2939,11 @@ jobs:
29422939
with:
29432940
name: devtools-amd64
29442941
path: ${{ github.workspace }}/BuildRoot/Library
2942+
- name: Download stdlib
2943+
uses: actions/download-artifact@v4
2944+
with:
2945+
name: Windows-stdlib-${{ matrix.arch }}
2946+
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform
29452947
- name: Download SDK
29462948
uses: actions/download-artifact@v4
29472949
with:
@@ -2991,6 +2993,10 @@ jobs:
29912993
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
29922994
29932995
# Download host SDK on top of the target SDK, so that the runtime DLLs are the host ones.
2996+
- uses: actions/download-artifact@v4
2997+
with:
2998+
name: Windows-stdlib-amd64
2999+
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform
29943000
- uses: actions/download-artifact@v4
29953001
with:
29963002
name: Windows-sdk-amd64

0 commit comments

Comments
 (0)