Skip to content

Commit 7ce649c

Browse files
ahoppenbnbarham
authored andcommitted
[Windows] Use a multiroot data file to test (corelibs-)foundation on Windows
We currently rebuild swift-syntax, swift-foundation-icu and swift-foundation twice: Once to test swift-foundation and once to test swift-corelibs-foundation. Using a unified build for both projects means that we only need to rebuild them once, saving ~5 minutes. (cherry picked from commit 61f833c)
1 parent 2f2051d commit 7ce649c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

utils/build.ps1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,12 +2842,16 @@ function Build-Foundation {
28422842
}
28432843

28442844
function Test-Foundation {
2845+
$ScratchPath = "$BinaryCache\$($BuildPlatform.Triple)\FoundationTests"
2846+
28452847
# Foundation tests build via swiftpm rather than CMake
28462848
Build-SPMProject `
28472849
-Action Test `
28482850
-Src $SourceCache\swift-foundation `
2849-
-Bin "$BinaryCache\$($BuildPlatform.Triple)\CoreFoundationTests" `
2850-
-Platform $BuildPlatform
2851+
-Bin "$ScratchPath" `
2852+
-Platform $BuildPlatform `
2853+
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
2854+
--test-product swift-foundationPackageTests
28512855

28522856
Invoke-IsolatingEnvVars {
28532857
$env:DISPATCH_INCLUDE_PATH="$(Get-SwiftSDK $BuildPlatform.OS)/usr/include"
@@ -2859,10 +2863,10 @@ function Test-Foundation {
28592863
Build-SPMProject `
28602864
-Action Test `
28612865
-Src $SourceCache\swift-corelibs-foundation `
2862-
-Bin "$BinaryCache\$($BuildPlatform.Triple)\FoundationTests" `
2866+
-Bin "$ScratchPath" `
28632867
-Platform $BuildPlatform `
2864-
-Configuration $FoundationTestConfiguration `
2865-
-j 1 # Running parallel causes a non-deterministic crash in CI only, see https://github.com/swiftlang/swift/issues/83606
2868+
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
2869+
--test-product swift-corelibs-foundationPackageTests
28662870
}
28672871
}
28682872

utils/build_swift/resources/SwiftPM-Unified-Build.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)