Skip to content

🚸 Provide CMakePresets.json#1660

Merged
denialhaag merged 22 commits into
mainfrom
cmake-presets
May 22, 2026
Merged

🚸 Provide CMakePresets.json#1660
denialhaag merged 22 commits into
mainfrom
cmake-presets

Conversation

@denialhaag
Copy link
Copy Markdown
Member

@denialhaag denialhaag commented Apr 23, 2026

Description

This PR defines a CMakePresets.json and updates the CI to utilize the defined presets.

Fixes #1622

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

@denialhaag denialhaag self-assigned this Apr 23, 2026
@denialhaag denialhaag added usability Anything related to usability c++ Anything related to C++ code labels Apr 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread CMakePresets.json
@denialhaag denialhaag marked this pull request as ready for review May 18, 2026 11:05
@denialhaag
Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d60cc63e-d45b-40a2-8b1d-d75511b3ba52

📥 Commits

Reviewing files that changed from the base of the PR and between 5ebd6a1 and 2579193.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • UPGRADING.md

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Introduced CMake presets for debug, release, coverage and lint, including Windows-specific presets for consistent cross‑platform builds and testing.
  • Documentation

    • Added upgrade guide and changelog entries documenting the new CMake presets and usage examples.
  • Chores

    • Bumped reusable workflow references across CI/CD pipelines, updating CI jobs and Python packaging/test workflows to newer workflow revisions.

Walkthrough

Adds CMakePresets.json and updates CI/CD/upstream workflows to newer reusable workflow revisions; CI C++ jobs now use preset matrices and forward preset-name, Windows derives mlir-debug from presets; Python packaging, CHANGELOG, and UPGRADING docs updated.

Changes

CMake Presets Adoption and CI Workflow Integration

Layer / File(s) Summary
CMake Presets v3 specification
CMakePresets.json
Defines hidden base configure presets with binaryDir and MLIR_DIR, OS-conditional bases, debug/release/coverage/lint and Windows debug/release presets; maps buildPresets and testPresets (hidden base with outputOnFailure and 600s timeout).
Standard C++ test jobs with presets
.github/workflows/ci.yml
Ubuntu, macOS, and Windows standard C++ test jobs switch to a preset matrix, forward preset-name to reusable workflows, and bump the reusable workflow revisions; Windows derives mlir-debug from the selected preset.
Extensive C++ test job variants with presets
.github/workflows/ci.yml
Extensive C++ test jobs for Ubuntu, macOS, and Windows now pass preset values, forward preset-name, and update reusable workflow revisions (includes Windows coverage ref update).
CI change-detection and C++ linter updates
.github/workflows/ci.yml
Update change-detection reusable workflow ref; C++ linter updates to a newer reusable workflow revision and removes the previously passed cmake-args input.
Python tests and packaging bumps
.github/workflows/ci.yml, .github/workflows/cd.yml
Python test/coverage/lint and extensive Python jobs update to newer reusable workflow revisions; packaging jobs (sdist, wheel/cibuildwheel) bumped to newer pinned refs in CI and CD.
Upstream workflow refs
.github/workflows/upstream.yml
qiskit-upstream-tests and create-issue-on-failure jobs updated to call newer pinned commits of reusable workflows.
CHANGELOG and UPGRADING docs
CHANGELOG.md, UPGRADING.md
Add Unreleased changelog entry and PR/link for CMake presets; add UPGRADING subsection documenting preset names, MLIR_DIR usage, and example cmake/ctest commands.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

continuous integration, github-actions

Suggested reviewers

  • burgholzer

Poem

🐰 In presets we hop, the builds align,

MLIR finds paths with a tidy sign,
CI forwards names, the tests take flight,
Unix, Windows—builds pass bright.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Provide CMakePresets.json' clearly describes the main change: introducing CMake presets configuration to the project.
Description check ✅ Passed The PR description covers the main objective, references the linked issue #1622, includes a mostly-completed checklist, and notes documentation updates are deferred.
Linked Issues check ✅ Passed The PR delivers the core objective from issue #1622: introducing CMakePresets.json and updating CI to utilize presets. Both the CMakePresets.json file and workflow updates address streamlining CMake configuration as required.
Out of Scope Changes check ✅ Passed All changes are in scope: CMakePresets.json introduction, workflow updates to reference presets, changelog/upgrade guide documentation, and CI reusable workflow version bumps directly support the presets adoption objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch cmake-presets

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@CMakePresets.json`:
- Around line 119-159: Add a new test preset named "lint" to the testPresets
array so the preset chain is complete: create an entry with "name": "lint",
"inherits": "base", "configurePreset": "lint", and "configuration": "Debug" so
that `cmake --preset lint` works for tests as well (mirror the pattern used by
"debug"/"release" presets).
- Around line 23-32: Add a brief clarifying description to the "base-windows"
preset to document that it intentionally omits a "generator" and relies on
CMake's default (Visual Studio/MSVC) on Windows; update the preset named
"base-windows" (the JSON object with "name": "base-windows" and "inherits":
"base") to include a "description" field like "Uses default generator (Visual
Studio/MSVC) on Windows" so future maintainers understand the generator strategy
and its alignment with CI.
- Around line 124-127: The test base preset in CMakePresets.json currently sets
a universal retry via the "execution.repeat" block ("mode": "until-pass",
"count": 3) which masks flaky tests; update the preset by removing or changing
this retry behavior (remove the "repeat" block or switch to a less forgiving
mode like "until-fail" or "after-timeout") and if you keep retries, add an
inline comment next to "execution.repeat" explaining the rationale and add a
corresponding note in docs/contributing.md or README about known instability,
plus implement or hook up logging/tracking of retry events so every retry is
recorded for monitoring.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 47470566-7f3e-4a19-9d2d-491784fa1a80

📥 Commits

Reviewing files that changed from the base of the PR and between e89c9f3 and 57cb8ab.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • CMakePresets.json

Comment thread CMakePresets.json
Comment thread CMakePresets.json
Comment thread CMakePresets.json Outdated
@denialhaag denialhaag requested a review from burgholzer May 18, 2026 11:36
@denialhaag
Copy link
Copy Markdown
Member Author

denialhaag commented May 18, 2026

The changelog and upgrade guide still need to be updated, but I'll do that after we've settled on the presets. 😌

@denialhaag
Copy link
Copy Markdown
Member Author

denialhaag commented May 20, 2026

The documentation update is postponed to munich-quantum-toolkit/templates#302.

@denialhaag denialhaag changed the title 🚸 Provide CMake presets 🚸 Provide CMakePresets.json May 20, 2026
This reverts commit 4ed0235.
@denialhaag
Copy link
Copy Markdown
Member Author

denialhaag commented May 20, 2026

@burgholzer, I have reverted 4ed0235 because it lead to a build error on windows-2025: https://github.com/munich-quantum-toolkit/core/actions/runs/26166116295/job/76970654827

I'd rather worry about this in a separate conversation before we hold up this PR. 😬

@burgholzer
Copy link
Copy Markdown
Member

Fairly sure that this is us either missing a link library or an include somewhere.
I can potentially check on my Windows VM when I am home.

Copy link
Copy Markdown
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

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

This generally LGTM 👍🏼
I left two comments.

What I was still wondering is whether we would want to have a little documentation for the presets that explains when to use which one (e.g. lint). But this can wait for a follow-up PR.
This should be practically close to merge-ready.
Once the new workflows are released, we should be able to get this in.

Comment thread .github/workflows/ci.yml
Comment thread CMakePresets.json Outdated
@denialhaag
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 @.github/workflows/ci.yml:
- Around line 136-142: The extensive Windows CI job cpp-tests-extensive-windows
does not propagate the mlir-debug flag to setup-mlir; update its with: block to
include mlir-debug: ${{ matrix.preset == 'debug-windows' }} so setup-mlir will
use the debug MLIR build for the debug-windows preset (add the mlir-debug key
alongside runs-on, compiler, setup-mlir, llvm-version, and preset-name).

In `@UPGRADING.md`:
- Line 42: Replace the incorrect gerund phrase "to providing" with the
infinitive "to provide" in the new CMake presets sentence (the line that
currently reads "[CMake presets] have been added to providing a standardized and
reproducible way to configure builds across different platforms.") so it reads
"...have been added to provide a standardized and reproducible way to configure
builds across different platforms."
🪄 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: ASSERTIVE

Plan: Pro

Run ID: ca0ab246-14de-4cf7-962f-91039e6e2946

📥 Commits

Reviewing files that changed from the base of the PR and between 57cb8ab and 5ebd6a1.

📒 Files selected for processing (6)
  • .github/workflows/cd.yml
  • .github/workflows/ci.yml
  • .github/workflows/upstream.yml
  • CHANGELOG.md
  • CMakePresets.json
  • UPGRADING.md

Comment thread .github/workflows/ci.yml
Comment thread UPGRADING.md Outdated
@denialhaag denialhaag requested a review from burgholzer May 22, 2026 13:13
Copy link
Copy Markdown
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

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

Nice!
Do we want to backport this to the v3.x branch? Probably, right?

@denialhaag denialhaag added the backport-potential Changes to be backported to the stable branch label May 22, 2026
@denialhaag
Copy link
Copy Markdown
Member Author

Do we want to backport this to the v3.x branch? Probably, right?

I'd say so!

@denialhaag
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@denialhaag denialhaag merged commit a4c20b9 into main May 22, 2026
42 checks passed
@denialhaag denialhaag deleted the cmake-presets branch May 22, 2026 14:13
@denialhaag denialhaag added dependencies Pull requests that update a dependency file github-actions Pull requests that update GitHub actions code labels May 22, 2026
denialhaag added a commit that referenced this pull request May 22, 2026
## Description

This PR defines a
[`CMakePresets.json`](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html)
and updates the CI to utilize the defined presets.

Fixes #1622 

## Checklist

- [x] The pull request only contains commits that are focused and
relevant to this change.
- [x] I have added appropriate tests that cover the new/changed
functionality.
- [x] ~~I have updated the documentation to reflect these changes.~~
- [x] I have added entries to the changelog for any noteworthy
additions, changes, fixes, or removals.
- [x] I have added migration instructions to the upgrade guide (if
needed).
- [x] The changes follow the project's style guidelines and introduce no
new warnings.
- [x] The changes are fully tested and pass the CI checks.
- [x] I have reviewed my own code changes.



(cherry picked from commit a4c20b9)

---------

Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-potential Changes to be backported to the stable branch c++ Anything related to C++ code dependencies Pull requests that update a dependency file github-actions Pull requests that update GitHub actions code usability Anything related to usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚸 Adopt cmake-presets

2 participants