Skip to content

Migrate Windows CI to Visual Studio 2026 and bump yaml-cpp to 0.9.0 - #1148

Merged
elazarg merged 2 commits into
mainfrom
fix/windows-ci-vs2026
Jun 22, 2026
Merged

Migrate Windows CI to Visual Studio 2026 and bump yaml-cpp to 0.9.0#1148
elazarg merged 2 commits into
mainfrom
fix/windows-ci-vs2026

Conversation

@elazarg

@elazarg elazarg commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Windows CI jobs fail at the CMake configure step:

CMake Error at CMakeLists.txt:12 (project):
  Generator

    Visual Studio 17 2022

  could not find any instance of Visual Studio.

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 (runner-images#14017). The pinned Visual Studio 17 2022 generator no longer matches any installed instance.

Fix

  • Use the windows-latest runner (now Windows Server 2025 + VS 2026) for the Windows jobs.
  • Switch the CMake generator to Visual Studio 18 2026.

The Visual Studio 18 2026 generator 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) and release.yaml (release artifacts).

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Both CI workflows (build.yml and release.yaml) replace the windows-2025 runner with windows-latest and switch the CMake generator from "Visual Studio 17 2022" to "Visual Studio 18 2026". build.yml also adds MATRIX_TARGET and BUILD_CONFIGURATION as job-level environment variables sourced from the matrix. Additionally, SetupYAMLCPP.cmake bumps the yaml-cpp dependency version from 0.8.0 to yaml-cpp-0.9.0.

Changes

Windows CI Toolchain Upgrade

Layer / File(s) Summary
Windows runner and CMake generator update
.github/workflows/build.yml, .github/workflows/release.yaml
Both workflows replace windows-2025 with windows-latest and update the CMake generator to "Visual Studio 18 2026". build.yml additionally introduces MATRIX_TARGET and BUILD_CONFIGURATION job-level env vars from the matrix.

yaml-cpp Dependency Update

Layer / File(s) Summary
yaml-cpp version upgrade
cmake/SetupYAMLCPP.cmake
FetchContent git tag for yaml-cpp is bumped from 0.8.0 to yaml-cpp-0.9.0.

Possibly related PRs

  • vbpf/prevail#857: Both PRs modify the yaml-cpp external dependency version (main PR bumps via SetupYAMLCPP.cmake, related PR bumps via ExternalProject_Add).
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the problem (Windows CI failures due to VS 2022 removal), the fix (switch to VS 2026 generator and windows-latest runner), and compatibility details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title directly summarizes the main changes: migrating Windows CI to Visual Studio 2026 and bumping yaml-cpp to 0.9.0, which matches the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-ci-vs2026

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6b799ee and dbc687d.

📒 Files selected for processing (1)
  • cmake/SetupYAMLCPP.cmake

Comment thread cmake/SetupYAMLCPP.cmake Outdated
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>
@elazarg
elazarg force-pushed the fix/windows-ci-vs2026 branch from dbc687d to 79c48fc Compare June 22, 2026 08:59
@elazarg elazarg changed the title Fix Windows CI: migrate to Visual Studio 2026 runner image Migrate Windows CI to Visual Studio 2026 and bump yaml-cpp to 0.9.0 Jun 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Unresolved: 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_MINIMUM is 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

📥 Commits

Reviewing files that changed from the base of the PR and between dbc687d and 79c48fc.

📒 Files selected for processing (1)
  • cmake/SetupYAMLCPP.cmake

Comment thread cmake/SetupYAMLCPP.cmake
@elazarg
elazarg merged commit 40faf76 into main Jun 22, 2026
16 checks passed
@elazarg
elazarg deleted the fix/windows-ci-vs2026 branch June 22, 2026 11:10
saxena-anurag pushed a commit to saxena-anurag/ebpf-verifier that referenced this pull request Jun 23, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant