Skip to content

Commit bc4ac8b

Browse files
committed
Add more debug log for swiftc invocation
1 parent 5b024e8 commit bc4ac8b

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

utils/build.ps1

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,51 @@ function Build-CMakeProject {
10751075
} else {
10761076
TryAdd-KeyValue $Defines CMAKE_Swift_COMPILER (Join-Path -Path (Get-PinnedToolchainTool) -ChildPath "swiftc.exe")
10771077
}
1078+
1079+
$DebugSwiftC = $Defines["CMAKE_Swift_COMPILER"]
1080+
Write-Host "DEBUG DEBUG DEBUG CMAKE_Swift_COMPILER: $DebugSwiftC"
1081+
$SwiftCDepDlls = dumpbin /Dependents $DebugSwiftC
1082+
Write-Host "DEBUG DEBUG DEBUG SwiftCDepDlls: $SwiftCDepDlls"
1083+
$SwiftCImports = dumpbin /Imports $DebugSwiftC
1084+
Write-Host "DEBUG DEBUG DEBUG SwiftCImports: $SwiftCImports"
1085+
1086+
$BinFolder = Split-Path $DebugSwiftC
1087+
Write-Host "DEBUG DEBUG DEBUG BinFolder: $BinFolder"
1088+
$DumpChildren = Get-ChildItem $BinFolder
1089+
Write-Host "DEBUG DEBUG DEBUG DumpChildren: $DumpChildren"
1090+
1091+
$SwiftDriver = Join-Path -Path $BinFolder -ChildPath "swift-driver.exe"
1092+
Write-Host "DEBUG DEBUG DEBUG SwiftDriver: $SwiftDriver"
1093+
$SwiftDriverDepDlls = dumpbin /Dependents $SwiftDriver
1094+
Write-Host "DEBUG DEBUG DEBUG SwiftDriverDepDlls: $SwiftDriverDepDlls"
1095+
1096+
$Dlls = @(
1097+
"swiftCore.dll"
1098+
"swift_Concurrency.dll"
1099+
"swiftWinSDK.dll"
1100+
"swiftCRT.dll"
1101+
"Foundation.dll"
1102+
"swiftDispatch.dll"
1103+
"BlocksRuntime.dll"
1104+
)
1105+
1106+
foreach ($Dll in $Dlls) {
1107+
$DllPath = Join-Path -Path $BinFolder -ChildPath $Dll
1108+
if (-Not (Test-Path $DllPath)) {
1109+
# Search through PATH to find the DLL
1110+
$DllPath = Get-Command $Dll -ErrorAction SilentlyContinue
1111+
if ($DllPath) {
1112+
$DllPath = $DllPath.Path
1113+
} else {
1114+
Write-Host "DEBUG DEBUG DEBUG Could not find ${Dll} in PATH"
1115+
continue
1116+
}
1117+
}
1118+
Write-Host "DEBUG DEBUG DEBUG Found ${Dll}: $DllPath"
1119+
$DllExports = dumpbin /exports $DllPath
1120+
Write-Host "DEBUG DEBUG DEBUG DllExports for ${Dll}: $DllExports"
1121+
}
1122+
10781123
if (-not ($Platform -eq "Windows")) {
10791124
TryAdd-KeyValue $Defines CMAKE_Swift_COMPILER_WORKS = "YES"
10801125
}

0 commit comments

Comments
 (0)