Skip to content

Commit 3483edb

Browse files
committed
[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.
1 parent 964f081 commit 3483edb

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

utils/build.ps1

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,12 +2410,17 @@ function Build-Foundation {
24102410
}
24112411

24122412
function Test-Foundation {
2413+
$ScratchPath = "$BinaryCache\$($Arch.LLVMTarget)\FoundationTests"
2414+
24132415
# Foundation tests build via swiftpm rather than CMake
24142416
Build-SPMProject `
24152417
-Action Test `
24162418
-Src $SourceCache\swift-foundation `
2417-
-Bin "$BinaryCache\$($BuildPlatform.Triple)\CoreFoundationTests" `
2418-
-Platform $BuildPlatform
2419+
-Bin "$ScratchPath" `
2420+
-Platform $BuildPlatform `
2421+
-Configuration $FoundationTestConfiguration `
2422+
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
2423+
--test-product swift-foundationPackageTests
24192424

24202425
Invoke-IsolatingEnvVars {
24212426
$env:DISPATCH_INCLUDE_PATH="$(Get-SwiftSDK Windows)/usr/include"
@@ -2427,9 +2432,11 @@ function Test-Foundation {
24272432
Build-SPMProject `
24282433
-Action Test `
24292434
-Src $SourceCache\swift-corelibs-foundation `
2430-
-Bin "$BinaryCache\$($BuildPlatform.Triple)\FoundationTests" `
2435+
-Bin "$ScratchPath" `
24312436
-Platform $BuildPlatform `
2432-
-Configuration $FoundationTestConfiguration
2437+
-Configuration $FoundationTestConfiguration `
2438+
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
2439+
--test-product swift-corelibs-foundationPackageTests
24332440
}
24342441
}
24352442

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)