Skip to content

[FIX,BUILD] vcpkg: backport Boost.Locale fix for configuring with CMake 4.5 (nightly Windows failure) - #10917

Closed
timosachsenberg wants to merge 1 commit into
developfrom
claude/laughing-wozniak-2yebw9
Closed

timosachsenberg wants to merge 1 commit into
developfrom
claude/laughing-wozniak-2yebw9

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

The nightly Release workflow has failed on Windows since 2026-11-15 (run 43785437565, run 43662157082). Both Windows jobs ("Build, Test, and Package (windows-2025, cl.exe)" and "Build the Windows Debug SDK dependencies") stop in vcpkg install:

CMake Error at libs/locale/CMakeLists.txt:236 (source_group):
  ".../libs/locale/include/boost/locale" is not a prefix of file
  ".../libs/locale/include/boost/locale.hpp"

Root cause

  • The only code change between the last green nightly (11-14) and the first red one was a JSON resource fix, so the cause is in the environment.
  • tools/ci/deps-windows.sh runs choco install cmake without a version, and that now installs CMake 4.5.0. A new CMake changes the vcpkg ABI hashes, so the binary cache restored 0 packages and every port was built from source.
  • Boost.Locale 1.91.0 passes include/boost/locale.hpp to source_group(TREE .../include/boost/locale ...). CMake 4.5 now checks the TREE root by path component and rejects it. Boost 1.92.0 (current vcpkg master) still has this bug. It is fixed upstream in boostorg/locale 1d07074 and f51b58c (CMake error in boost 1.92.0 locale module with CMake 4.5.0 boostorg/boost#1162).

Fix
This PR adds an overlay port vcpkg-overlays/ports/boost-locale. It is a copy of the vcpkg port at our current baseline (features.cmake is identical, and vcpkg.json only gains port-version: 1). The port applies the upstream change as a patch: the exact diff boost-1.91.0..f51b58c of CMakeLists.txt, which is 3 lines. This fixes the build itself instead of pinning CMake to dodge it, so local vcpkg builds with CMake ≥ 4.5 on any platform work again too. Drop the overlay once the vcpkg baseline ships a fixed Boost.Locale.

Testing (local, Linux)

  • Minimal source_group repro: CMake 4.2.0 passes, 4.5.0 fails, and 4.5.0 passes with the patched logic.
  • Boost 1.91.0 superproject with -DBOOST_INCLUDE_LIBRARIES=locale and CMake 4.5.0: unpatched fails with the same error at line 236. After git apply of the overlay patch, configure succeeds and boost_locale builds.
  • vcpkg install boost-locale --overlay-ports=vcpkg-overlays/ports resolves to [email protected]#1 from the overlay. A full vcpkg build was not possible here because the sandbox blocks GitHub archive downloads.

Not verified / caveat
The failing Windows run stopped at boost-locale. Other ports built later in that run might also fail under CMake 4.5. Only this PR's Windows CI can show that. The first run will rebuild all Windows vcpkg ports, because the cache misses with the new CMake.

Checklist

  • Make sure that you are listed in the AUTHORS file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

AI use (see the OpenMS AI Policy)

  • I have read the OpenMS AI Policy, and I understand, have reviewed and tested every change in this PR and can explain it in my own words
  • AI use in this PR (tick one):
    • None
    • Assisted (e.g. completion, suggestions, small edits); commits carry an Assisted-by: trailer
    • Substantial (e.g. agentic tools wrote significant parts); commits carry a Co-authored-by: trailer, and the description above explains the design intent and rationale

This PR was opened by a scheduled nightly-CI check. A human maintainer needs to review it before merging.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for Boost.Locale 1.91.0, with optional ICU support and platform-appropriate localization backends.
  • Bug Fixes
    • Improved compatibility with CMake 4.5 and Linux-to-MinGW builds.
    • Adjusted backend and standard locale settings across supported platforms, including Windows and Android.

…ke 4.5

The nightly Release workflow fails on Windows since 2026-11-15:
tools/ci/deps-windows.sh installs the latest CMake from Chocolatey, which
is now 4.5.0. The new CMake changes the vcpkg ABI hashes, so the binary
cache misses and all ports are built from source, and boost-locale 1.91.0
fails to configure:

  CMake Error at libs/locale/CMakeLists.txt:236 (source_group):
    ".../include/boost/locale" is not a prefix of file
    ".../include/boost/locale.hpp"

CMake 4.5 checks the TREE root of source_group() per path component, and
Boost.Locale passes locale.hpp (which lives next to, not inside,
include/boost/locale/) in that list. Boost 1.92.0 still has the bug; it
is fixed upstream in boostorg/locale 1d07074 and f51b58c
(boostorg/boost#1162).

Add an overlay of the vcpkg boost-locale port (identical to the one at
our vcpkg baseline) that applies the upstream change as a patch. This
also fixes local vcpkg builds with CMake >= 4.5 on any platform. The
overlay can be dropped once the vcpkg baseline ships a fixed release.

Tested on Linux with CMake 4.5.0 against a Boost 1.91.0 checkout:
unpatched configure fails with the same error at line 236, patched
configure succeeds and boost_locale builds; CMake 4.2.0 is unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Atu9S2mWRtHFrHzhER78Sy
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

This change adds a vcpkg overlay for Boost.Locale 1.91.0. The overlay defines dependencies and backend options, configures and installs the port, and applies a patch that changes how include/boost/locale.hpp is assigned to a CMake source group.

Changes: Boost.Locale port

Layer / File(s) Summary
Port manifest and feature options
vcpkg-overlays/ports/boost-locale/vcpkg.json, vcpkg-overlays/ports/boost-locale/features.cmake
The manifest defines the port version, platform restriction, dependencies, and optional ICU feature. Feature options set ICU, Iconv, and POSIX backend flags by platform and add them to FEATURE_OPTIONS.
Port build and source-group patch
vcpkg-overlays/ports/boost-locale/portfile.cmake, vcpkg-overlays/ports/boost-locale/0001-cmake-4.5-source-group.patch
The portfile fetches Boost.Locale, applies the patch, loads feature options, and configures and installs the port. The patch assigns include/boost/locale.hpp to headers before the TREE source-group command.

Possibly related PRs

Suggested reviewers: poshul

Change: Bug fix

Merge Risk: Minimal · up to 59467

This adds a vcpkg overlay for Boost.Locale that applies the upstream CMake 4.5 source_group fix. It only affects builds that use the overlay port and can be removed once the baseline ships a fixed release. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: a vcpkg backport of the Boost.Locale fix for configuring with CMake 4.5, and it notes the nightly Windows failure. The raw summary confirms the overlay patches the source_g…
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.
Full details: Title check

Explanation

The title names the change: a vcpkg backport of the Boost.Locale fix for configuring with CMake 4.5, and it notes the nightly Windows failure. The raw summary confirms the overlay patches the source_group ordering in Boost.Locale, which matches the title's main point. The title is concise and specific, and it uses the [FIX,BUILD] prefix style.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the source group tree,
Boost.Locale joins the build with glee.
The headers find their proper place,
The port sets flags for each platform case.
Then off the rabbit hops with cheer.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 426feb1f-0459-4814-a39e-eb429971d618
Commits

Reviewing files that changed from the base of the PR and between 65851d7 and 5946754.

Files selected for processing: 4

  • vcpkg-overlays/ports/boost-locale/0001-cmake-4.5-source-group.patch
  • vcpkg-overlays/ports/boost-locale/features.cmake
  • vcpkg-overlays/ports/boost-locale/portfile.cmake
  • vcpkg-overlays/ports/boost-locale/vcpkg.json

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@timosachsenberg timosachsenberg left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Independent review of the Boost.Locale overlay at 59467545 (focused on the overlay's interaction with future vcpkg baseline updates). One substantive issue is noted inline. Validation was a local, isolated CMake mock; I did not run a complete vcpkg/OpenMS build.

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO boostorg/locale
REF boost-${VERSION}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

P2 — Guard against Boost version skew when updating the vcpkg baseline. This overlay permanently selects Boost.Locale 1.91.0 (vcpkg.json + REF boost-${VERSION}), and vcpkg resolves overlay ports before registry versioning. If the pinned baseline is upgraded to Boost 1.92 while this overlay is left in place, the other Boost ports can move to 1.92 but Locale still builds as 1.91. That can produce an inconsistent Boost installation instead of a clear diagnostic. This PR overlaps #10904, which already implements a fail-fast check against the installed boost/version.hpp; please retain that check here (or prefer #10904 rather than merging this version).

Independent validation: I executed the two portfile variants under cmake -P with stubbed vcpkg functions and an installed-header fixture defining BOOST_VERSION 109200 while VERSION is 1.91.0. This PR's portfile proceeded to vcpkg_from_github/installation (exit 0); the guarded #10904 variant stopped with Overlay=1.91.0, baseline=1.92.0 (exit 1). The fixture tests only the version-guard control flow, not actual vcpkg dependency resolution or a full build. See vcpkg overlay precedence.

@timosachsenberg timosachsenberg left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

AI-generated initial review

This is an automated, AI-generated first review. It looks only for high- and medium-priority issues (no nits) and checks whether the PR has tests and measurements. Please double-check anything before acting on it; a maintainer will follow up. I reviewed 59467545 (one commit) against develop (65851d76).

What I checked:

  • Comparison with #10904: I fetched both branches and diffed vcpkg-overlays/ports/boost-locale/.
    • The patch hunk is byte-identical (same index c0b4e69..efae306).
    • features.cmake and the dependency list in vcpkg.json are identical.
    • Differences: this PR adds a header to the patch and a $comment to vcpkg.json, and it does not have #10904's Boost version check in portfile.cmake.
  • CI on 5946754 (at the time of this review):
    • Passing: Linux g++, clang++ and ARM, macOS, cppcheck, and the Linux, Linux-ARM and macOS wheel builds.
    • Still running: build-and-test (windows-2025, cl.exe) and build-wheels-windows, the two jobs that show whether the fix works.
  • Linux wheel log: vcpkg resolves boost-locale:[email protected]#1 -- /project/./vcpkg-overlays/ports/boost-locale, applies the patch and builds the port. It restores 143 of 146 packages from the cache. This shows that vcpkg accepts the patch header and the $comment field.
  • No local build. The change affects only vcpkg's build of one dependency, and the evidence that matters is Windows CI with CMake 4.5.

Verdict:

  • High priority: none in the change itself.
  • Medium priority: 2, below.

1. This PR duplicates #10904, which already passes on Windows

  • #10904, opened on 2026-11-15 by the same nightly routine, adds the same overlay with the same patch.
  • Its CI on its head ba45fee passed build-and-test (windows-2025, cl.exe) and build-wheels-windows with CMake 4.5.0. It rebuilt all 166 ports from source, then built and tested OpenMS.
  • That run also answers the caveat in this description ("Other ports built later in that run might also fail under CMake 4.5"): no other port fails.
  • Both PRs add vcpkg-overlays/ports/boost-locale/{portfile.cmake,vcpkg.json,features.cmake}, so whichever merges second gets add/add conflicts.
  • Mitigation:
    • Merge only one. #10904 is the more complete one: it has the version guard, and its Windows run is green.
    • If you want this PR's patch header, copy it into #10904's patch before closing this one.
    • For the routine that opens these PRs: check for an open PR about the same nightly failure before opening a new one.

2. With no version guard, a later baseline bump silently keeps Boost.Locale at 1.91.0 (portfile.cmake)

  • The inline thread on portfile.cmake:8 already raises this, and I agree it is medium priority.
  • Overlay ports take precedence over the baseline. The version>= entries in the overlay's vcpkg.json are only lower bounds.
  • So after a baseline bump to Boost 1.92, every other Boost port moves while boost-locale stays at 1.91.0. It is then built against the 1.92 headers of boost-config, boost-core, boost-thread and the others. The result is a mixed Boost install with no clear error.
  • Mitigation: add the check from #10904, or merge #10904 instead. That check reads BOOST_VERSION from ${CURRENT_INSTALLED_DIR}/include/boost/version.hpp, which the direct dependency boost-config installs. If that version differs from ${VERSION}, it stops with a FATAL_ERROR. It already ran on the real boost-config in #10904's CI on all platforms.

Tests

  • No repository test covers a vcpkg port, so CI is the test here. Your local checks fit the change:
    • a minimal source_group repro (CMake 4.2 passes, 4.5 fails, 4.5 with the patch passes);
    • configuring and building the Boost 1.91.0 superproject with and without the patch.
  • Not covered: "Build the Windows Debug SDK dependencies" (release.yml). It failed in the nightly too, and PR CI does not run it, in this PR or in #10904.
  • Suggestion: before merging, do a dry run of the Release workflow on the branch you merge (workflow_dispatch with deploy off). Alternatively, check the next nightly right after merging.

Measurements

  • Not applicable, since no runtime code changes.
  • The only cost is a one-off rebuild of boost-locale and the packages that depend on it in each vcpkg cache.

Description

  • The description explains the root cause, the fix and the caveats.
  • The AI use is disclosed ("Substantial"), and the commit has a Co-Authored-By: trailer.
  • There is no CHANGELOG edit.
  • The description does not mention #10904. Please link it, or close one of the two PRs.

Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Closing this as a duplicate of #10904. That PR adds the same boost-locale overlay with the same upstream patch, and its Windows CI passed with CMake 4.5. It also adds a check that stops the build if the vcpkg baseline moves to another Boost release, so the overlay can't silently keep boost-locale at 1.91.0.


Generated by Claude Code

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.

2 participants