From 4405251696c71729d627c8f06c758293400af408 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Mon, 17 Mar 2025 17:02:52 -0700 Subject: [PATCH] [tests] Run swift-(corelibs-)foundation tests in debug configuration on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should improve CI times because building in debug configuration instead of release configuration is significantly faster. Since we don’t install the build of swift-(corelibs-)foundation using SwiftPM into the toolchain, this doesn’t have any performance impact on users of the toolchain. --- utils/build.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 5463278a6c740..62845fcfaf929 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -107,6 +107,9 @@ The memory allocator used in the toolchain binaries, if it's `mimalloc`, it uses mimalloc. Otherwise, it uses the default allocator. +.PARAMETER FoundationTestConfiguration +Whether to run swift-foundation and swift-corelibs-foundation tests in a debug or release configuration. + .EXAMPLE PS> .\Build.ps1 @@ -142,6 +145,8 @@ param( [switch] $Clean, [switch] $DebugInfo, [switch] $EnableCaching, + [ValidateSet("debug", "release")] + [string] $FoundationTestConfiguration = "debug", [string] $Cache = "", [string] $Allocator = "", [switch] $Summary, @@ -1234,6 +1239,7 @@ function Build-SPMProject { [string] $Src, [string] $Bin, [hashtable] $Arch, + [string] $Configuration = "release", [Parameter(ValueFromRemainingArguments)] [string[]] $AdditionalArguments ) @@ -1263,7 +1269,7 @@ function Build-SPMProject { $Arguments = @( "--scratch-path", $Bin, "--package-path", $Src, - "-c", "release", + "-c", $Configuration, "-Xbuild-tools-swiftc", "-I$SDKInstallRoot\usr\lib\swift", "-Xbuild-tools-swiftc", "-L$SDKInstallRoot\usr\lib\swift\windows", "-Xcc", "-I$SDKInstallRoot\usr\lib\swift", @@ -1851,7 +1857,8 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) { -Action Test ` -Src $SourceCache\swift-foundation ` -Bin $OutDir ` - -Arch $HostArch + -Arch $HostArch ` + -Configuration $FoundationTestConfiguration } $OutDir = Join-Path -Path $HostArch.BinaryCache -ChildPath foundation-tests @@ -1869,7 +1876,8 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) { -Action Test ` -Src $SourceCache\swift-corelibs-foundation ` -Bin $OutDir ` - -Arch $HostArch + -Arch $HostArch ` + -Configuration $FoundationTestConfiguration } } else { $DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch