Skip to content

fix: Windows build#1166

Open
gennaroprota wants to merge 4 commits intocppalliance:developfrom
gennaroprota:fix/windows_build
Open

fix: Windows build#1166
gennaroprota wants to merge 4 commits intocppalliance:developfrom
gennaroprota:fix/windows_build

Conversation

@gennaroprota
Copy link
Collaborator

No description provided.

CMake 3.27 introduced CMP0144, which changes how upper-case package name
variables are handled in find_package. Setting the policy to NEW
suppresses deprecation warnings.
@github-actions
Copy link

github-actions bot commented Mar 16, 2026

🚧 Danger.js checks for MrDocs are experimental; expect some rough edges while we tune the rules.

⚠️ Warnings

Warning

PR description looks empty. Please add a short rationale and testing notes.

🧾 Changes by Scope

Scope Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🏗️ Build / Toolchain 17 11 6 2 - 2 - -
📄 Docs 2 - 2 1 - 1 - -
Total 19 11 8 3 - 3 - -

Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)

🔝 Top Files

  • CMakeLists.txt (Build / Toolchain): 15 lines Δ (+10 / -5)
  • docs/package-lock.json (Docs): 2 lines Δ (+0 / -2)
  • util/bootstrap/src/recipes/loader.py (Build / Toolchain): 2 lines Δ (+1 / -1)

Generated by 🚫 dangerJS against bb34b23

@cppalliance-bot
Copy link

cppalliance-bot commented Mar 16, 2026

An automated preview of the documentation is available at https://1166.mrdocs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-03-16 11:52:16 UTC

The LLVM CMakePresets use "win" (e.g. release-win, debug-win), not
"windows". The incorrect suffix caused preset lookup failures when
bootstrapping on Windows.
Remove stale peer dependency markers for @asciidoctor/core and progress.
@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.44%. Comparing base (0a69301) to head (bb34b23).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1166   +/-   ##
========================================
  Coverage    77.44%   77.44%           
========================================
  Files          313      313           
  Lines        29475    29475           
  Branches      5880     5880           
========================================
  Hits         22827    22827           
  Misses        4403     4403           
  Partials      2245     2245           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

On Windows, bootstrap.py installs LibXml2 with a CMake config package,
so find_package() only succeeds in CONFIG mode. On Linux, system
libxml2-dev is found via CMake's FindLibXml2 module.

So, try config mode first; fall back to module mode if that fails.
find_package(LibXml2)
# Try config mode first (e.g. libxml2 installed by bootstrap.py),
# then fall back to module mode (e.g. system libxml2-dev on Linux).
find_package(LibXml2 CONFIG)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure, but I think there's a way to make config fall back to regular mode. If so, it would be more like:

if (MRDOCS_BUILD_STRICT_TESTS)
    # Strict mode expects xml-lint to run; require LibXml2.
    find_package(LibXml2 CONFIG REQUIRED)
else()
    find_package(LibXml2 CONFIG)
 endif()

If we use this pattern often, we can also create a REQUIRED_IF_STRICT_TESTS variable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could do:

set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
if (MRDOCS_BUILD_STRICT_TESTS)
    find_package(LibXml2 REQUIRED)
else()
    find_package(LibXml2)
endif()

The variable is documented since CMake 3.15. MrDocs requires CMake >= 3.13, though, so we'd need to check if 3.15 is acceptable; but, realistically, any current toolchain has it.

Downside: CMAKE_FIND_PACKAGE_PREFER_CONFIG is global, so it would affect all subsequent find_package calls in the same scope. We could use a save/restore.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Exactly. Great idea.

I'm looking at this again, and I suspect #1168 will end up obsoleting this PR, though. Because the new bootstrap script had to cover all of that to actually work in CI. So it had to fix the root of the problem.

@gennaroprota gennaroprota changed the title Fix Windows build fix: Windows build Mar 18, 2026
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.

3 participants