Skip to content

Commit 9adf8c3

Browse files
committed
fix: add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to x64-windows-static.cmake
1 parent b920a0e commit 9adf8c3

File tree

2 files changed

+37
-13
lines changed

2 files changed

+37
-13
lines changed

ci/kokoro/windows/builds/cmake.ps1

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,24 @@ if ($missing.count -ge 1) {
4343
$project_root = (Get-Item -Path ".\" -Verbose).FullName -replace "\\", "/"
4444
$vcpkg_root = Install-Vcpkg "${project_root}" ""
4545
$binary_dir="cmake-out/${BuildName}"
46+
47+
Write-Host -ForegroundColor Cyan "----------------------------------------------------------------"
48+
Write-Host -ForegroundColor Cyan "Dumping environment and config before vcpkg install..."
49+
Write-Host -ForegroundColor Cyan "----------------------------------------------------------------"
50+
51+
Write-Host -ForegroundColor Yellow "========= Dumping relevant environment variables ========="
52+
Get-ChildItem env: | Where-Object { $_.Name -like "VCPKG_*" -or $_.Name -like "CMAKE_*" } | Format-List
53+
Write-Host -ForegroundColor Yellow "=========================================================="
54+
55+
$triplet_file = "${project_root}/ci/kokoro/windows/triplets/x64-windows-static.cmake"
56+
Write-Host -ForegroundColor Yellow "========= Dumping triplet file ($triplet_file) ========="
57+
if (Test-Path $triplet_file) {
58+
Get-Content $triplet_file
59+
} else {
60+
Write-Host -ForegroundColor Red "Triplet file not found at $triplet_file"
61+
}
62+
Write-Host -ForegroundColor Yellow "=========================================================="
63+
4664
# Install all dependencies from the vcpkg.json manifest file.
4765
# This mirrors the behavior of our GHA builds.
4866
Write-Host -ForegroundColor Yellow "Attempting vcpkg install..."
@@ -52,21 +70,26 @@ Write-Host -ForegroundColor Yellow "Attempting vcpkg install..."
5270
if ($LastExitCode -ne 0) {
5371
Write-Host -ForegroundColor Red "----------------------------------------------------------------"
5472
Write-Host -ForegroundColor Red "vcpkg install FAILED with exit code $LastExitCode."
55-
Write-Host -ForegroundColor Red "Dumping vcpkg buildtree logs for crc32c..."
73+
Write-Host -ForegroundColor Red "Dumping vcpkg buildtree logs for known failing packages..."
5674
Write-Host -ForegroundColor Red "----------------------------------------------------------------"
5775

58-
# Define the log files based on the error message
59-
$log1 = "${vcpkg_root}/buildtrees/crc32c/config-x64-windows-static-out.log"
60-
$log2 = "${vcpkg_root}/buildtrees/crc32c/config-x64-windows-static-dbg-CMakeCache.txt.log"
61-
$log3 = "${vcpkg_root}/buildtrees/crc32c/config-x64-windows-static-rel-CMakeCache.txt.log"
62-
63-
foreach ($logFile in @($log1, $log2, $log3)) {
64-
if (Test-Path $logFile) {
65-
Write-Host -ForegroundColor Red "========= Contents of $logFile ========="
66-
Get-Content $logFile
67-
Write-Host -ForegroundColor Red "========= End of $logFile ========="
68-
} else {
69-
Write-Host -ForegroundColor Yellow "Log file not found, skipping: $logFile"
76+
# We'll check logs for *all* known problematic packages
77+
$problem_packages = @("crc32c", "yaml-cpp")
78+
79+
foreach ($pkg in $problem_packages) {
80+
Write-Host -ForegroundColor Magenta "--- Checking logs for $pkg ---"
81+
$log1 = "${vcpkg_root}/buildtrees/${pkg}/config-x64-windows-static-out.log"
82+
$log2 = "${vcpkg_root}/buildtrees/${pkg}/config-x64-windows-static-dbg-CMakeCache.txt.log"
83+
$log3 = "${vcpkg_root}/buildtrees/${pkg}/config-x64-windows-static-rel-CMakeCache.txt.log"
84+
85+
foreach ($logFile in @($log1, $log2, $log3)) {
86+
if (Test-Path $logFile) {
87+
Write-Host -ForegroundColor Red "========= Contents of $logFile ========="
88+
Get-Content $logFile
89+
Write-Host -ForegroundColor Red "========= End of $logFile ========="
90+
} else {
91+
Write-Host -ForegroundColor Yellow "Log file not found, skipping: $logFile"
92+
}
7093
}
7194
}
7295

ci/kokoro/windows/triplets/x64-windows-static.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ set(VCPKG_LIBRARY_LINKAGE static)
44
set(VCPKG_VISUAL_STUDIO_PATH
55
"C:\\Program Files (x86)\\Microsoft Visual Studio\\$ENV{MSVC_VERSION}\\BuildTools"
66
)
7+
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "${VCPKG_CMAKE_CONFIGURE_OPTIONS};-DCMAKE_POLICY_VERSION_MINIMUM=3.5")

0 commit comments

Comments
 (0)