Migrate Windows CI to Visual Studio 2026 and bump yaml-cpp to 0.9.0 - #1148
Conversation
GitHub migrated the windows-2025 / windows-latest runner images to Visual Studio 2026 (v18) between 2026-06-08 and 2026-06-15, removing Visual Studio 2022. CMake configure now fails with: Generator Visual Studio 17 2022 could not find any instance of Visual Studio. Switch the Windows jobs to windows-latest and the "Visual Studio 18 2026" CMake generator (supported since CMake 4.2; the image ships CMake 4.3.3). Applies to both the CI build and release workflows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Elazar Gershuni <elazarg@gmail.com>
📝 WalkthroughWalkthroughBoth CI workflows ( ChangesWindows CI Toolchain Upgrade
yaml-cpp Dependency Update
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmake/SetupYAMLCPP.cmake`:
- Line 30: The issue is that when CMAKE_POLICY_VERSION_MINIMUM is undefined,
saving it to _prevail_saved_policy_min captures an empty string, and later
restoration sets CMAKE_POLICY_VERSION_MINIMUM to empty string instead of leaving
it undefined. In CMake, these are not equivalent states. Fix this by checking if
CMAKE_POLICY_VERSION_MINIMUM is defined before saving it to
_prevail_saved_policy_min, storing a marker to indicate whether it was defined
or not, and then during restoration (around lines 33-34) either setting
CMAKE_POLICY_VERSION_MINIMUM to the saved value or unsetting it entirely based
on whether it was originally defined.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 06622ede-9990-4b11-9d65-9498476ccbd3
📒 Files selected for processing (1)
cmake/SetupYAMLCPP.cmake
The Visual Studio 2026 runner image ships CMake 4.3, which removed compatibility with cmake_minimum_required(VERSION < 3.5). The FetchContent fallback pulled yaml-cpp 0.8.0, whose CMakeLists declares cmake_minimum_required(VERSION 3.4), so Windows test configure failed: Compatibility with CMake < 3.5 has been removed from CMake. yaml-cpp 0.9.0 declares cmake_minimum_required(VERSION 3.5...3.30) and configures cleanly under CMake 4.x, so no policy override is needed. The tag is "yaml-cpp-0.9.0" (the bare "0.8.0" tag scheme changed). Ubuntu was unaffected because it resolves yaml-cpp via the system package and never takes the FetchContent path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Elazar Gershuni <elazarg@gmail.com>
dbc687d to
79c48fc
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmake/SetupYAMLCPP.cmake (1)
30-34:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUnresolved: CMAKE_POLICY_VERSION_MINIMUM handling still incorrect.
A prior review flagged that lines 30-34 do not properly handle the case when
CMAKE_POLICY_VERSION_MINIMUMis initially undefined. Setting a variable to an empty string is not equivalent to unsetting it in CMake. This issue remains in the current code and should be fixed.🛡️ Proposed fix for CMAKE_POLICY_VERSION_MINIMUM handling
+if(DEFINED CMAKE_POLICY_VERSION_MINIMUM) set(_prevail_saved_policy_min "${CMAKE_POLICY_VERSION_MINIMUM}") + set(_prevail_policy_was_defined TRUE) +else() + set(_prevail_policy_was_defined FALSE) +endif() set(CMAKE_POLICY_VERSION_MINIMUM 3.5) FetchContent_MakeAvailable(yaml-cpp) +if(_prevail_policy_was_defined) set(CMAKE_POLICY_VERSION_MINIMUM "${_prevail_saved_policy_min}") + unset(_prevail_saved_policy_min) +else() + unset(CMAKE_POLICY_VERSION_MINIMUM) +endif() -unset(_prevail_saved_policy_min) +unset(_prevail_policy_was_defined)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmake/SetupYAMLCPP.cmake` around lines 30 - 34, The CMAKE_POLICY_VERSION_MINIMUM handling in SetupYAMLCPP.cmake incorrectly uses set(CMAKE_POLICY_VERSION_MINIMUM "") to clear the variable, but in CMake setting a variable to an empty string is not equivalent to unsetting it. Replace any set(CMAKE_POLICY_VERSION_MINIMUM "") calls with unset(CMAKE_POLICY_VERSION_MINIMUM) to properly handle the case when CMAKE_POLICY_VERSION_MINIMUM should be undefined.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmake/SetupYAMLCPP.cmake`:
- Line 22: The yaml-cpp upgrade to version 0.9.0 introduces a breaking change
where accessing missing YAML keys throws InvalidNode exceptions instead of
BadConversion exceptions. Review the exception handling code in ebpf_yaml.cpp,
marshal.cpp, and parse.cpp to identify all try-catch blocks that currently catch
BadConversion exceptions and update them to catch InvalidNode exceptions
instead. Ensure all error handling logic that previously relied on BadConversion
is adapted to work with the new exception type.
---
Outside diff comments:
In `@cmake/SetupYAMLCPP.cmake`:
- Around line 30-34: The CMAKE_POLICY_VERSION_MINIMUM handling in
SetupYAMLCPP.cmake incorrectly uses set(CMAKE_POLICY_VERSION_MINIMUM "") to
clear the variable, but in CMake setting a variable to an empty string is not
equivalent to unsetting it. Replace any set(CMAKE_POLICY_VERSION_MINIMUM "")
calls with unset(CMAKE_POLICY_VERSION_MINIMUM) to properly handle the case when
CMAKE_POLICY_VERSION_MINIMUM should be undefined.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: a43015b6-2253-456d-9f39-bdbfc4c15b60
📒 Files selected for processing (1)
cmake/SetupYAMLCPP.cmake
…bpf#1148) * Fix Windows CI: migrate to Visual Studio 2026 runner image GitHub migrated the windows-2025 / windows-latest runner images to Visual Studio 2026 (v18) between 2026-06-08 and 2026-06-15, removing Visual Studio 2022. CMake configure now fails with: Generator Visual Studio 17 2022 could not find any instance of Visual Studio. Switch the Windows jobs to windows-latest and the "Visual Studio 18 2026" CMake generator (supported since CMake 4.2; the image ships CMake 4.3.3). Applies to both the CI build and release workflows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Elazar Gershuni <elazarg@gmail.com> * Update fetched yaml-cpp to 0.9.0 The Visual Studio 2026 runner image ships CMake 4.3, which removed compatibility with cmake_minimum_required(VERSION < 3.5). The FetchContent fallback pulled yaml-cpp 0.8.0, whose CMakeLists declares cmake_minimum_required(VERSION 3.4), so Windows test configure failed: Compatibility with CMake < 3.5 has been removed from CMake. yaml-cpp 0.9.0 declares cmake_minimum_required(VERSION 3.5...3.30) and configures cleanly under CMake 4.x, so no policy override is needed. The tag is "yaml-cpp-0.9.0" (the bare "0.8.0" tag scheme changed). Ubuntu was unaffected because it resolves yaml-cpp via the system package and never takes the FetchContent path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Elazar Gershuni <elazarg@gmail.com> --------- Signed-off-by: Elazar Gershuni <elazarg@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Anurag Saxena <anusa@microsoft.com>
Problem
The Windows CI jobs fail at the CMake configure step:
GitHub migrated the
windows-2025/windows-latestrunner images to Visual Studio 2026 (v18) between 2026-06-08 and 2026-06-15, removing Visual Studio 2022 (runner-images#14017). The pinnedVisual Studio 17 2022generator no longer matches any installed instance.Fix
windows-latestrunner (now Windows Server 2025 + VS 2026) for the Windows jobs.Visual Studio 18 2026.The
Visual Studio 18 2026generator is supported since CMake 4.2; the VS 2026 image ships CMake 4.3.3, so no toolchain bump is required.Applies the same change to both
build.yml(CI) andrelease.yaml(release artifacts).🤖 Generated with Claude Code