CI: support Visual Studio 2026 (v18 / v145) generator#184
Conversation
📝 WalkthroughWalkthroughAdds Visual Studio 2026 (VS18) support by extending the generator-to-toolset mapping and enabling CoinMP to reuse the vendored VS17 solution with a retargeted ChangesVS2026 and Modernized Windows Build System
Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
🧹 Nitpick comments (1)
libraries.cmake/coinor.cmake (1)
46-53: ⚡ Quick winLimit
CONTRIB_MSBUILD_PLATFORMTOOLSETscope to CoinMP builds only.
CONTRIB_MSBUILD_PLATFORMTOOLSETis set as global state and consumed byOPENMS_BUILDLIB, so the override can leak into later library builds. Clear it after the CoinMP targets (or pass it explicitly per call) to avoid cross-library side effects.Proposed adjustment
@@ OPENMS_BUILDLIB("CoinOR-OsiClp (Debug)" MSBUILD_ARGS_SLN MSBUILD_ARGS_TARGET "Debug" COINOR_DIR) OPENMS_BUILDLIB("CoinOR-OsiClp (Release)" MSBUILD_ARGS_SLN MSBUILD_ARGS_TARGET "Release" COINOR_DIR) + # Keep PlatformToolset override local to CoinMP builds + unset(CONTRIB_MSBUILD_PLATFORMTOOLSET)🤖 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 `@libraries.cmake/coinor.cmake` around lines 46 - 53, The variable CONTRIB_MSBUILD_PLATFORMTOOLSET is being set as global state within the conditional block where CONTRIB_VS_VERSION is checked, and this can leak into subsequent library builds since it persists as a global cmake variable that OPENMS_BUILDLIB consumes. After the CoinMP targets are built and the CONTRIB_MSBUILD_PLATFORMTOOLSET value is no longer needed, unset or clear this variable to prevent it from affecting other library builds, or alternatively pass the CONTRIB_MSBUILD_PLATFORMTOOLSET value explicitly in individual OPENMS_BUILDLIB calls rather than relying on global state.
🤖 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.
Nitpick comments:
In `@libraries.cmake/coinor.cmake`:
- Around line 46-53: The variable CONTRIB_MSBUILD_PLATFORMTOOLSET is being set
as global state within the conditional block where CONTRIB_VS_VERSION is
checked, and this can leak into subsequent library builds since it persists as a
global cmake variable that OPENMS_BUILDLIB consumes. After the CoinMP targets
are built and the CONTRIB_MSBUILD_PLATFORMTOOLSET value is no longer needed,
unset or clear this variable to prevent it from affecting other library builds,
or alternatively pass the CONTRIB_MSBUILD_PLATFORMTOOLSET value explicitly in
individual OPENMS_BUILDLIB calls rather than relying on global state.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 37efe1e6-d56c-4cae-991f-3abc5d9a8c1f
📒 Files selected for processing (4)
.github/workflows/main.ymlCMakeLists.txtlibraries.cmake/coinor.cmakemacros.cmake
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 `@libraries.cmake/boost.cmake`:
- Around line 179-189: The verification loop iterating over Boost components is
missing the math component that is included in the _BOOST_LIBS list. Add math to
the foreach loop that iterates over the components (date_time, iostreams, regex,
system, thread) to ensure that if Boost.Math fails to install its CMake config,
the check will catch it at contrib-build time as intended.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 90a47f09-a84f-4eb8-8b63-1e1146e44fb9
📒 Files selected for processing (2)
CMakeLists.txtlibraries.cmake/boost.cmake
| ## Fail LOUDLY at contrib-build time (not later at OpenMS configure) if the | ||
| ## six-library list mis-split or a component failed to install: assert each | ||
| ## expected per-component config dir exists under the install prefix. | ||
| foreach(_BOOST_COMP date_time iostreams regex system thread) | ||
| file(GLOB _BOOST_COMP_CFG "${PROJECT_BINARY_DIR}/lib/cmake/boost_${_BOOST_COMP}-*") | ||
| if (NOT _BOOST_COMP_CFG) | ||
| message(FATAL_ERROR "Boost component '${_BOOST_COMP}' did not install a CMake config dir " | ||
| "under ${PROJECT_BINARY_DIR}/lib/cmake/boost_${_BOOST_COMP}-* -- " | ||
| "BOOST_INCLUDE_LIBRARIES likely mis-split or the build is incomplete.") | ||
| endif() | ||
| endforeach() |
There was a problem hiding this comment.
Missing math component in post-install verification.
The verification loop checks only 5 of the 6 compiled components. math is listed in _BOOST_LIBS (line 69) but is missing from the verification foreach at line 182.
If Boost.Math fails to install its CMake config, this check won't catch it at contrib-build time, defeating the stated purpose of failing loudly here rather than later at OpenMS configure.
Proposed fix
- foreach(_BOOST_COMP date_time iostreams regex system thread)
+ foreach(_BOOST_COMP math date_time iostreams regex system thread)🤖 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 `@libraries.cmake/boost.cmake` around lines 179 - 189, The verification loop
iterating over Boost components is missing the math component that is included
in the _BOOST_LIBS list. Add math to the foreach loop that iterates over the
components (date_time, iostreams, regex, system, thread) to ensure that if
Boost.Math fails to install its CMake config, the check will catch it at
contrib-build time as intended.
Advances contrib from 1d341d7 to a867776 (OpenMS/contrib#184, all platforms green), which additionally builds Boost via its CMake superproject on Windows (the b2 engine bootstrap cannot target the VS2026 / vc145 toolset). Lets this PR's Windows job exercise the complete contrib build on windows-2025. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitHub Actions' windows-2025 / windows-latest images migrated to Visual
Studio 2026 (MSVC v145) in June 2026, removing VS2022. The CMake generator
guard previously only accepted VS {14..17}, so the contrib build aborted
with a FATAL_ERROR on the new runners.
- CMakeLists.txt: accept the "Visual Studio 18 2026" generator (VS_VERSION
18, toolset 14.5 / v145).
- coinor.cmake: the vendored CoinMP archive (-vs22) only ships MSBuild
solutions up to v17. For VS>=18, reuse the v17 solution and retarget the
PlatformToolset (v14x ABI is binary compatible).
- macros.cmake: OPENMS_BUILDLIB passes /p:PlatformToolset when retargeting.
- .github/workflows/main.yml: build with the VS2026 generator on
windows-latest and pin CMake 4.3.x there (the VS18 generator needs >=4.2).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Boost.Build engine bootstrap (bootstrap.bat) cannot target the VS2026 /
vc145 toolset ("Unknown toolset: vcunk"), so Boost never builds. Build Boost
with its native CMake superproject instead -- no b2 engine bootstrap, no
toolset table to satisfy; the nested configure reuses the parent generator and
${ARCHITECTURE_OPTION_CMAKE} like zlib.cmake/bzip2.cmake, inheriting the active
v145 toolset.
- Windows uses boostorg's "-cmake" release archive (modular libs/*/include
layout + top-level CMakeLists.txt), mirrored to OpenMS/contrib-sources
(sha256 78fbf579...). The canonical boost.org tarball has only the unified
boost/ header tree and no superproject CMakeLists, so it cannot drive the
modular CMake build. Extracts to the same boost-1.87.0/ dir (BOOST_DIR
unchanged). Unix keeps the canonical tarball + b2.
- Build the FULL Boost so the complete header tree is installed: downstream
consumers (Arrow/Thrift) and OpenMS use many header-only Boost libs beyond a
handful, matching what the old b2 "install" produced.
- Static libs + dynamic CRT (/MD,/MDd), Debug+Release installed into one
prefix, BoostConfig.cmake under lib/cmake/Boost-1.87.0 consumed unchanged by
OpenMS's find_package(Boost CONFIG). ICU off; iostreams compression off
(OpenMS uses no iostreams filter and links zlib/bzip2 directly).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
a867776 to
7504732
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
libraries.cmake/boost.cmake (1)
248-261:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winStatus message includes
--with-toolsetbut actual command does not.The log messages at lines 248, 258, and 261 claim bootstrap.sh is invoked with
--with-toolset=${_boost_bootstrap_toolchain}, but the actualexecute_processcommand at line 249 omits this argument. This discrepancy will mislead developers debugging build failures.Either add
--with-toolset=${_boost_bootstrap_toolchain}to the actual command, or remove it from the messages to match reality.Option A: Remove from messages to match current behavior
- message(STATUS "Bootstrapping Boost libraries (./bootstrap.sh --prefix=${PROJECT_BINARY_DIR} --with-toolset=${_boost_bootstrap_toolchain} --with-libraries=date_time,filesystem,iostreams,math,regex,system,thread) ...") + message(STATUS "Bootstrapping Boost libraries (./bootstrap.sh --prefix=${PROJECT_BINARY_DIR} --with-libraries=date_time,filesystem,iostreams,math,regex,system,thread) ...")(Apply similar fix to lines 258 and 261)
🤖 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 `@libraries.cmake/boost.cmake` around lines 248 - 261, The status messages at lines 248, 258, and 261 reference the --with-toolset argument in the bootstrap.sh command, but the actual execute_process command at line 249 does not include this argument. Remove --with-toolset=${_boost_bootstrap_toolchain} from all three message calls to match what is actually being executed, ensuring the logged messages accurately reflect the real command being run.
♻️ Duplicate comments (1)
libraries.cmake/boost.cmake (1)
176-186:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winMissing
mathandfilesystemcomponents in post-install verification.The verification loop checks 5 components but the Linux/Mac path (line 249) builds 7 libraries including
filesystemandmath. If either fails to install its CMake config, this check won't detect it at contrib-build time.Proposed fix
- foreach(_BOOST_COMP date_time iostreams regex system thread) + foreach(_BOOST_COMP date_time filesystem iostreams math regex system thread)🤖 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 `@libraries.cmake/boost.cmake` around lines 176 - 186, The verification loop in the foreach statement only checks 5 Boost components (date_time, iostreams, regex, system, thread) but the Linux/Mac build path actually builds 7 components including filesystem and math. Add the missing filesystem and math components to the list of components being verified in the foreach loop so that if either fails to install its CMake config directory, the check will catch it and fail loudly at contrib-build time rather than later during OpenMS configuration.
🤖 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.
Outside diff comments:
In `@libraries.cmake/boost.cmake`:
- Around line 248-261: The status messages at lines 248, 258, and 261 reference
the --with-toolset argument in the bootstrap.sh command, but the actual
execute_process command at line 249 does not include this argument. Remove
--with-toolset=${_boost_bootstrap_toolchain} from all three message calls to
match what is actually being executed, ensuring the logged messages accurately
reflect the real command being run.
---
Duplicate comments:
In `@libraries.cmake/boost.cmake`:
- Around line 176-186: The verification loop in the foreach statement only
checks 5 Boost components (date_time, iostreams, regex, system, thread) but the
Linux/Mac build path actually builds 7 components including filesystem and math.
Add the missing filesystem and math components to the list of components being
verified in the foreach loop so that if either fails to install its CMake config
directory, the check will catch it and fail loudly at contrib-build time rather
than later during OpenMS configuration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 17728647-9e7e-4636-bf6b-6672415ec4c2
📒 Files selected for processing (5)
.github/workflows/main.ymlCMakeLists.txtlibraries.cmake/boost.cmakelibraries.cmake/coinor.cmakemacros.cmake
🚧 Files skipped from review as they are similar to previous changes (4)
- macros.cmake
- libraries.cmake/coinor.cmake
- .github/workflows/main.yml
- CMakeLists.txt
* CI: migrate Windows build to Visual Studio 2026 (windows-2025 runner) GitHub Actions' windows-2025 / windows-latest images moved to Visual Studio 2026 (MSVC v145) in June 2026, removing VS2022. windows-2022 now also maps to that image, so pinning it no longer helps and the hardcoded "Visual Studio 17 2022" contrib generator fails with "could not find any instance of Visual Studio", breaking the nightly full CI. - Bump contrib submodule to pick up the "Visual Studio 18 2026" generator support (OpenMS/contrib#184). - dependencies action: build contrib with -G"Visual Studio 18 2026" (runner CMake is >=4.3, which the VS18 generator requires). - full CI matrix: run the Windows job on windows-2025; refresh the compiler_ver (14.51 / v145) used for the ccache key and build name. Qt stays on win64_msvc2022_64 (no msvc2026 build exists; ABI-compatible with v145). The OpenMS build itself uses Ninja + the VS shell, which now picks up cl.exe v145 automatically. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * CI: bump contrib submodule to the full VS2026 fix (Boost via CMake) Advances contrib from 1d341d7 to a867776 (OpenMS/contrib#184, all platforms green), which additionally builds Boost via its CMake superproject on Windows (the b2 engine bootstrap cannot target the VS2026 / vc145 toolset). Lets this PR's Windows job exercise the complete contrib build on windows-2025. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * CI: install Ghostscript via conda-forge, not chocolatey (windows-2025 hang) On the windows-2025 (Server 2025 / VS2026) image, the chocolatey 'ghostscript' package's installer (gs10071w64.exe) hangs for the full 2700s execution timeout and fails the job in the dependencies step -- before OpenMS is even built. (Seen on PR #9514's windows job: contrib built fine, then the deps step died on Ghostscript.) Move ghostscript to the conda-forge install alongside doxygen (which was moved earlier for the same class of choco unreliability). conda-forge ships it into Library/bin, already on PATH, so the docs build (enable_docs=ON) still finds it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * CI: re-point contrib submodule to rebased VS2026 branch contrib's ci-vs2026-migration was rebased onto current contrib/master (integrating the concurrent Arrow debug-build, cmake-minimum 3.26 and Boost.filesystem fixes) and squashed to two commits; bump the submodule from the pre-rebase a867776 to the rebased tip 7504732. The Windows full-Boost build already installs filesystem, so the new Boost.filesystem requirement is covered. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * CI: point contrib submodule at merged master (VS2026 support) contrib#184 was squash-merged; advance the submodule from the PR-branch commit 7504732 to the resulting master commit e127dea (identical tree). This makes the submodule reference contrib/master rather than the now-merged PR branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Why
GitHub Actions'
windows-2025/windows-latestrunner images migrated to Visual Studio 2026 (MSVC v145) during June 2026 (rollout completed 2026-06-15), and VS2022 is no longer installed. The contrib CMake generator guard previously only acceptedVisual Studio {14..17}, so the contrib build aborted immediately:and, with the VS18 generator, the guard's
else()branch raised aFATAL_ERROR.This broke the nightly OpenMS full CI (it builds contrib from source) and the contrib release workflow.
What
Visual Studio 18 2026generator (VS_VERSION18, toolset14.5/ v145).CoinMP-1.8.3-vs22) only ships MSBuild solutions up tov17. For VS ≥ 18 we reuse thev17solution and retarget thePlatformToolset(the v14x ABI is binary compatible).OPENMS_BUILDLIBpasses/p:PlatformToolset=<vNNN>to MSBuild when retargeting.windows-latest, and pin CMake 4.3.x there (theVisual Studio 18 2026generator requires CMake ≥ 4.2; Linux/macOS keep3.29.x).The VS2022 path is unchanged byte-for-byte (no toolset override when
VS_VERSION == 17).🤖 Generated with Claude Code
Summary by CodeRabbit