Skip to content

Commit fc2420d

Browse files
committed
[DNM] Log all the things
1 parent a5ef5fe commit fc2420d

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

utils/build.ps1

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ param
175175
# Debug Information
176176
[switch] $DebugInfo,
177177
[ValidateSet("codeview", "dwarf")]
178-
[string] $CDebugFormat = "dwarf",
178+
[string] $CDebugFormat = "codeview",
179179
[ValidateSet("codeview", "dwarf")]
180-
[string] $SwiftDebugFormat = "dwarf",
180+
[string] $SwiftDebugFormat = "codeview",
181181

182182
# Android SDK Options
183183
[switch] $Android = $false,
@@ -244,10 +244,11 @@ if ($WindowsSDKArchitectures.Length -eq 1) { $WindowsSDKArchitectures = $Windows
244244

245245
if ($Test.Length -eq 1) { $Test = $Test[0].Split(",") }
246246

247-
if ($Test -contains "*") {
248-
# Explicitly don't include llbuild yet since tests are known to fail on Windows
249-
$Test = @("lld", "lldb", "swift", "dispatch", "foundation", "xctest", "swift-format", "sourcekit-lsp")
250-
}
247+
#if ($Test -contains "*") {
248+
# # Explicitly don't include llbuild yet since tests are known to fail on Windows
249+
# $Test = @("lld", "lldb", "swift", "dispatch", "foundation", "xctest", "swift-format", "sourcekit-lsp")
250+
#}
251+
$Test = @("foundation")
251252

252253
if ($UseHostToolchain -is [string]) {
253254
$UseHostToolchain = [System.Convert]::ToBoolean($UseHostToolchain)
@@ -1369,6 +1370,7 @@ function Build-CMakeProject {
13691370
[switch] $AddAndroidCMakeEnv = $false,
13701371
[switch] $UseGNUDriver = $false,
13711372
[string] $SwiftSDK = $null,
1373+
[switch] $IncludeDebugInfo = $DebugInfo,
13721374
[hashtable] $Defines = @{}, # Values are either single strings or arrays of flags
13731375
[string[]] $BuildTargets = @()
13741376
)
@@ -1435,7 +1437,7 @@ function Build-CMakeProject {
14351437
Add-KeyValueIfNew $Defines CMAKE_ASM_FLAGS @("--target=$($Platform.Triple)")
14361438
Add-KeyValueIfNew $Defines CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "/MD"
14371439

1438-
if ($DebugInfo) {
1440+
if ($IncludeDebugInfo) {
14391441
$ASMDebugFlags = if ($CDebugFormat -eq "dwarf") {
14401442
if ($UseGNUDriver) { @("-gdwarf") } else { @("-clang:-gdwarf") }
14411443
} else {
@@ -1485,7 +1487,7 @@ function Build-CMakeProject {
14851487
@("/GS-", "/Gw", "/Gy", "/Oy", "/Oi", "/Zc:inline")
14861488
}
14871489

1488-
if ($DebugInfo) {
1490+
if ($IncludeDebugInfo) {
14891491
if ($UsePinnedCompilers.Contains("C") -or $UseBuiltCompilers.Contains("C")) {
14901492
if ($CDebugFormat -eq "dwarf") {
14911493
$CFLAGS += if ($UseGNUDriver) {
@@ -1525,7 +1527,7 @@ function Build-CMakeProject {
15251527
@("/GS-", "/Gw", "/Gy", "/Oy", "/Oi", "/Zc:inline", "/Zc:__cplusplus")
15261528
}
15271529

1528-
if ($DebugInfo) {
1530+
if ($IncludeDebugInfo) {
15291531
if ($UsePinnedCompilers.Contains("CXX") -or $UseBuiltCompilers.Contains("CXX")) {
15301532
if ($CDebugFormat -eq "dwarf") {
15311533
$CXXFLAGS += if ($UseGNUDriver) {
@@ -1565,7 +1567,7 @@ function Build-CMakeProject {
15651567
@()
15661568
}
15671569

1568-
$SwiftFlags += if ($DebugInfo) {
1570+
$SwiftFlags += if ($IncludeDebugInfo) {
15691571
if ($SwiftDebugFormat -eq "dwarf") {
15701572
@("-g", "-debug-info-format=dwarf", "-use-ld=lld-link", "-Xlinker", "/DEBUG:DWARF")
15711573
} else {
@@ -1592,7 +1594,7 @@ function Build-CMakeProject {
15921594
@("/INCREMENTAL:NO", "/OPT:REF", "/OPT:ICF")
15931595
}
15941596

1595-
if ($DebugInfo) {
1597+
if ($IncludeDebugInfo) {
15961598
if ($UseASM -or $UseC -or $UseCXX) {
15971599
# Prefer `/Z7` over `/ZI`
15981600
# By setting the debug information format, the appropriate C/C++
@@ -1629,7 +1631,7 @@ function Build-CMakeProject {
16291631
Add-KeyValueIfNew $Defines CMAKE_C_COMPILER_TARGET $Platform.Triple
16301632

16311633
$CFLAGS = @("--sysroot=${AndroidSysroot}", "-ffunction-sections", "-fdata-sections")
1632-
if ($DebugInfo) {
1634+
if ($IncludeDebugInfo) {
16331635
$CFLAGS += @("-gdwarf")
16341636
}
16351637
Add-FlagsDefine $Defines CMAKE_C_FLAGS $CFLAGS
@@ -1639,7 +1641,7 @@ function Build-CMakeProject {
16391641
Add-KeyValueIfNew $Defines CMAKE_CXX_COMPILER_TARGET $Platform.Triple
16401642

16411643
$CXXFLAGS = @("--sysroot=${AndroidSysroot}", "-ffunction-sections", "-fdata-sections")
1642-
if ($DebugInfo) {
1644+
if ($IncludeDebugInfo) {
16431645
$CXXFLAGS += @("-gdwarf")
16441646
}
16451647
Add-FlagsDefine $Defines CMAKE_CXX_FLAGS $CXXFLAGS
@@ -1678,7 +1680,7 @@ function Build-CMakeProject {
16781680
"-Xclang-linker", "-resource-dir", "-Xclang-linker", "${AndroidPrebuiltRoot}\lib\clang\$($(Get-AndroidNDK).ClangVersion)"
16791681
)
16801682

1681-
$SwiftFlags += if ($DebugInfo) { @("-g") } else { @("-gnone") }
1683+
$SwiftFlags += if ($IncludeDebugInfo) { @("-g") } else { @("-gnone") }
16821684

16831685
Add-FlagsDefine $Defines CMAKE_Swift_FLAGS $SwiftFlags
16841686
# Workaround CMake 3.26+ enabling `-wmo` by default on release builds
@@ -1861,10 +1863,11 @@ function Build-SPMProject {
18611863
}
18621864
Test {
18631865
$ActionName = "test"
1866+
$Arguments += @("-v")
18641867
}
18651868
TestParallel {
18661869
$ActionName = "test"
1867-
$Arguments += @("--parallel")
1870+
$Arguments += @("--parallel", "-v")
18681871
}
18691872
}
18701873

@@ -2938,8 +2941,10 @@ function Test-Foundation {
29382941
-Src $SourceCache\swift-foundation `
29392942
-Bin "$ScratchPath" `
29402943
-Platform $BuildPlatform `
2944+
-Configuration $FoundationTestConfiguration `
29412945
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
2942-
--test-product swift-foundationPackageTests
2946+
--test-product swift-foundationPackageTests `
2947+
-j 2
29432948

29442949
Invoke-IsolatingEnvVars {
29452950
$env:DISPATCH_INCLUDE_PATH="$(Get-SwiftSDK $BuildPlatform.OS)/usr/include"
@@ -2953,8 +2958,10 @@ function Test-Foundation {
29532958
-Src $SourceCache\swift-corelibs-foundation `
29542959
-Bin "$ScratchPath" `
29552960
-Platform $BuildPlatform `
2961+
-Configuration $FoundationTestConfiguration `
29562962
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
2957-
--test-product swift-corelibs-foundationPackageTests
2963+
--test-product swift-corelibs-foundationPackageTests `
2964+
-j 2
29582965
}
29592966
}
29602967

@@ -3366,6 +3373,7 @@ function Build-Driver([Hashtable] $Platform) {
33663373
-Platform $Platform `
33673374
-UseBuiltCompilers C,CXX,Swift `
33683375
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
3376+
-IncludeDebugInfo `
33693377
-Defines @{
33703378
BUILD_SHARED_LIBS = "YES";
33713379
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";

0 commit comments

Comments
 (0)