Skip to content

Commit 85c4a3b

Browse files
committed
[DNM] Log all the things
1 parent 4becc5d commit 85c4a3b

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
@@ -121,9 +121,9 @@ param
121121
[System.IO.FileInfo] $BinaryCache = "S:\b",
122122
[System.IO.FileInfo] $ImageRoot = "S:",
123123
[ValidateSet("codeview", "dwarf")]
124-
[string] $CDebugFormat = "dwarf",
124+
[string] $CDebugFormat = "codeview",
125125
[ValidateSet("codeview", "dwarf")]
126-
[string] $SwiftDebugFormat = "dwarf",
126+
[string] $SwiftDebugFormat = "codeview",
127127
[ValidateRange(1, 36)]
128128
[int] $AndroidAPILevel = 28,
129129
[string[]] $AndroidSDKVersions = @("Android", "AndroidExperimental"),
@@ -199,10 +199,11 @@ if ($WindowsSDKArchitectures.Length -eq 1) { $WindowsSDKArchitectures = $Windows
199199

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

202-
if ($Test -contains "*") {
203-
# Explicitly don't include llbuild yet since tests are known to fail on Windows
204-
$Test = @("lld", "lldb", "swift", "dispatch", "foundation", "xctest", "swift-format", "sourcekit-lsp")
205-
}
202+
#if ($Test -contains "*") {
203+
# # Explicitly don't include llbuild yet since tests are known to fail on Windows
204+
# $Test = @("lld", "lldb", "swift", "dispatch", "foundation", "xctest", "swift-format", "sourcekit-lsp")
205+
#}
206+
$Test = @("foundation")
206207

207208
## Declare static build and build tool parameters.
208209

@@ -1310,6 +1311,7 @@ function Build-CMakeProject {
13101311
[switch] $AddAndroidCMakeEnv = $false,
13111312
[switch] $UseGNUDriver = $false,
13121313
[string] $SwiftSDK = $null,
1314+
[switch] $IncludeDebugInfo = $DebugInfo,
13131315
[hashtable] $Defines = @{}, # Values are either single strings or arrays of flags
13141316
[string[]] $BuildTargets = @()
13151317
)
@@ -1376,7 +1378,7 @@ function Build-CMakeProject {
13761378
Add-KeyValueIfNew $Defines CMAKE_ASM_FLAGS @("--target=$($Platform.Triple)")
13771379
Add-KeyValueIfNew $Defines CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "/MD"
13781380

1379-
if ($DebugInfo) {
1381+
if ($IncludeDebugInfo) {
13801382
$ASMDebugFlags = if ($CDebugFormat -eq "dwarf") {
13811383
if ($UseGNUDriver) { @("-gdwarf") } else { @("-clang:-gdwarf") }
13821384
} else {
@@ -1426,7 +1428,7 @@ function Build-CMakeProject {
14261428
@("/GS-", "/Gw", "/Gy", "/Oy", "/Oi", "/Zc:inline")
14271429
}
14281430

1429-
if ($DebugInfo) {
1431+
if ($IncludeDebugInfo) {
14301432
if ($UsePinnedCompilers.Contains("C") -or $UseBuiltCompilers.Contains("C")) {
14311433
if ($CDebugFormat -eq "dwarf") {
14321434
$CFLAGS += if ($UseGNUDriver) {
@@ -1466,7 +1468,7 @@ function Build-CMakeProject {
14661468
@("/GS-", "/Gw", "/Gy", "/Oy", "/Oi", "/Zc:inline", "/Zc:__cplusplus")
14671469
}
14681470

1469-
if ($DebugInfo) {
1471+
if ($IncludeDebugInfo) {
14701472
if ($UsePinnedCompilers.Contains("CXX") -or $UseBuiltCompilers.Contains("CXX")) {
14711473
if ($CDebugFormat -eq "dwarf") {
14721474
$CXXFLAGS += if ($UseGNUDriver) {
@@ -1506,7 +1508,7 @@ function Build-CMakeProject {
15061508
@()
15071509
}
15081510

1509-
$SwiftFlags += if ($DebugInfo) {
1511+
$SwiftFlags += if ($IncludeDebugInfo) {
15101512
if ($SwiftDebugFormat -eq "dwarf") {
15111513
@("-g", "-debug-info-format=dwarf", "-use-ld=lld-link", "-Xlinker", "/DEBUG:DWARF")
15121514
} else {
@@ -1533,7 +1535,7 @@ function Build-CMakeProject {
15331535
@("/INCREMENTAL:NO", "/OPT:REF", "/OPT:ICF")
15341536
}
15351537

1536-
if ($DebugInfo) {
1538+
if ($IncludeDebugInfo) {
15371539
if ($UseASM -or $UseC -or $UseCXX) {
15381540
# Prefer `/Z7` over `/ZI`
15391541
# By setting the debug information format, the appropriate C/C++
@@ -1570,7 +1572,7 @@ function Build-CMakeProject {
15701572
Add-KeyValueIfNew $Defines CMAKE_C_COMPILER_TARGET $Platform.Triple
15711573

15721574
$CFLAGS = @("--sysroot=${AndroidSysroot}", "-ffunction-sections", "-fdata-sections")
1573-
if ($DebugInfo) {
1575+
if ($IncludeDebugInfo) {
15741576
$CFLAGS += @("-gdwarf")
15751577
}
15761578
Add-FlagsDefine $Defines CMAKE_C_FLAGS $CFLAGS
@@ -1580,7 +1582,7 @@ function Build-CMakeProject {
15801582
Add-KeyValueIfNew $Defines CMAKE_CXX_COMPILER_TARGET $Platform.Triple
15811583

15821584
$CXXFLAGS = @("--sysroot=${AndroidSysroot}", "-ffunction-sections", "-fdata-sections")
1583-
if ($DebugInfo) {
1585+
if ($IncludeDebugInfo) {
15841586
$CXXFLAGS += @("-gdwarf")
15851587
}
15861588
Add-FlagsDefine $Defines CMAKE_CXX_FLAGS $CXXFLAGS
@@ -1619,7 +1621,7 @@ function Build-CMakeProject {
16191621
"-Xclang-linker", "-resource-dir", "-Xclang-linker", "${AndroidPrebuiltRoot}\lib\clang\$($(Get-AndroidNDK).ClangVersion)"
16201622
)
16211623

1622-
$SwiftFlags += if ($DebugInfo) { @("-g") } else { @("-gnone") }
1624+
$SwiftFlags += if ($IncludeDebugInfo) { @("-g") } else { @("-gnone") }
16231625

16241626
Add-FlagsDefine $Defines CMAKE_Swift_FLAGS $SwiftFlags
16251627
# Workaround CMake 3.26+ enabling `-wmo` by default on release builds
@@ -1802,10 +1804,11 @@ function Build-SPMProject {
18021804
}
18031805
Test {
18041806
$ActionName = "test"
1807+
$Arguments += @("-v")
18051808
}
18061809
TestParallel {
18071810
$ActionName = "test"
1808-
$Arguments += @("--parallel")
1811+
$Arguments += @("--parallel", "-v")
18091812
}
18101813
}
18111814

@@ -2850,8 +2853,10 @@ function Test-Foundation {
28502853
-Src $SourceCache\swift-foundation `
28512854
-Bin "$ScratchPath" `
28522855
-Platform $BuildPlatform `
2856+
-Configuration $FoundationTestConfiguration `
28532857
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
2854-
--test-product swift-foundationPackageTests
2858+
--test-product swift-foundationPackageTests `
2859+
-j 2
28552860

28562861
Invoke-IsolatingEnvVars {
28572862
$env:DISPATCH_INCLUDE_PATH="$(Get-SwiftSDK $BuildPlatform.OS)/usr/include"
@@ -2865,8 +2870,10 @@ function Test-Foundation {
28652870
-Src $SourceCache\swift-corelibs-foundation `
28662871
-Bin "$ScratchPath" `
28672872
-Platform $BuildPlatform `
2873+
-Configuration $FoundationTestConfiguration `
28682874
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
2869-
--test-product swift-corelibs-foundationPackageTests
2875+
--test-product swift-corelibs-foundationPackageTests `
2876+
-j 2
28702877
}
28712878
}
28722879

@@ -3201,6 +3208,7 @@ function Build-Driver([Hashtable] $Platform) {
32013208
-Platform $Platform `
32023209
-UseBuiltCompilers C,CXX,Swift `
32033210
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
3211+
-IncludeDebugInfo `
32043212
-Defines @{
32053213
BUILD_SHARED_LIBS = "YES";
32063214
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";

0 commit comments

Comments
 (0)