Skip to content

Commit 6053b15

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 deb1d96 commit 6053b15

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

utils/build.ps1

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,12 +2362,16 @@ function Build-Foundation {
23622362
}
23632363

23642364
function Test-Foundation {
2365+
$ScratchPath = "$BinaryCache\$($Arch.LLVMTarget)\FoundationTests"
2366+
23652367
# Foundation tests build via swiftpm rather than CMake
23662368
Build-SPMProject `
23672369
-Action Test `
23682370
-Src $SourceCache\swift-foundation `
2369-
-Bin "$BinaryCache\$($BuildArch.LLVMTarget)\CoreFoundationTests" `
2370-
-Arch $BuildArch
2371+
-Bin "$ScratchPath" `
2372+
-Arch $BuildArch `
2373+
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
2374+
--test-product swift-foundationPackageTests
23712375

23722376
Invoke-IsolatingEnvVars {
23732377
$env:DISPATCH_INCLUDE_PATH="$(Get-SwiftSDK Windows)/usr/include"
@@ -2379,9 +2383,10 @@ function Test-Foundation {
23792383
Build-SPMProject `
23802384
-Action Test `
23812385
-Src $SourceCache\swift-corelibs-foundation `
2382-
-Bin "$BinaryCache\$($BuildArch.LLVMTarget)\FoundationTests" `
2386+
-Bin "$ScratchPath" `
23832387
-Arch $BuildArch `
2384-
-Configuration $FoundationTestConfiguration
2388+
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
2389+
--test-product swift-corelibs-foundationPackageTests
23852390
}
23862391
}
23872392

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)