Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚨 Run clang-tidy on MLIR subproject, switch to LLVM@20, and update to CMake >= 3.24 #879

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Mar 19, 2025

Description

This pull request enables running clang-tidy for the MLIR subproject and updates the project to use LLVM version 20. This enhances code quality checks and aligns the project with the latest LLVM updates. It is also the same version currently shipped with CLion.

In addition, this PR raises the minimum supported CMake version to 3.24, which brings in several improvements:

  • Better FetchContent functionality (no more backwords-compatible workarounds)
  • Support for file sets which can be used to automatically install header files associated with a target.
  • CMAKE_VERIFY_INTERFACE_HEADER_SETS to enable build rules that verify all headers in header sets can be used on their own.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

@burgholzer burgholzer self-assigned this Mar 19, 2025
@burgholzer burgholzer added dependencies Pull requests that update a dependency file code quality Code quality improvements continuous integration Anything related to the CI setup c++ Anything related to C++ code MLIR Anything related to MLIR labels Mar 19, 2025
Copy link

codecov bot commented Mar 19, 2025

Codecov Report

Attention: Patch coverage is 84.04255% with 15 lines in your changes missing coverage. Please review.

Project coverage is 92.5%. Comparing base (96b46fc) to head (4642a92).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
include/mqt-core/dd/Operations.hpp 42.8% 4 Missing ⚠️
src/dd/Simulation.cpp 0.0% 4 Missing ⚠️
src/ir/operations/StandardOperation.cpp 0.0% 3 Missing ⚠️
src/circuit_optimizer/CircuitOptimizer.cpp 60.0% 2 Missing ⚠️
src/ir/QuantumComputation.cpp 95.2% 1 Missing ⚠️
src/ir/operations/SymbolicOperation.cpp 50.0% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (84.0%) is below the target coverage (90.0%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #879     +/-   ##
=======================================
+ Coverage   92.3%   92.5%   +0.2%     
=======================================
  Files        145     145             
  Lines      13850   13841      -9     
  Branches    2107    2107             
=======================================
+ Hits       12789   12815     +26     
+ Misses      1061    1026     -35     
Flag Coverage Δ
cpp 92.3% <84.0%> (+0.2%) ⬆️
python 98.4% <ø> (ø)
Files with missing lines Coverage Δ
include/mqt-core/datastructures/Layer.hpp 89.1% <ø> (ø)
...nclude/mqt-core/datastructures/UndirectedGraph.hpp 100.0% <ø> (ø)
include/mqt-core/dd/Complex.hpp 100.0% <100.0%> (ø)
include/mqt-core/dd/ComplexValue.hpp 87.5% <100.0%> (ø)
include/mqt-core/dd/ComputeTable.hpp 100.0% <ø> (ø)
include/mqt-core/dd/DDDefinitions.hpp 100.0% <ø> (ø)
include/mqt-core/dd/NoiseFunctionality.hpp 100.0% <ø> (ø)
include/mqt-core/dd/Package.hpp 96.7% <ø> (ø)
include/mqt-core/dd/RealNumber.hpp 100.0% <ø> (ø)
...lude/mqt-core/dd/StochasticNoiseOperationTable.hpp 92.5% <ø> (ø)
... and 51 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@burgholzer burgholzer added this to the MQT Core milestone Mar 19, 2025
@burgholzer burgholzer changed the title 🚨 Enable running clang-tidy for the MLIR subproject and switch to LLVM@19 🚨 Enable running clang-tidy for the MLIR subproject and switch to LLVM@20 Mar 20, 2025
@burgholzer
Copy link
Member Author

@flowerthrower @ystade just venting my frustration here. Of course the LLVM set up would be making problems with clang-tidy.. it's not like that is actually part of the same monorepository..
I'll play around with this a little more and try to make it not complain, but at some point I am just going to put // IWYU pragma: ignore etc. in the respective parts and merge this to move it forward.

@burgholzer burgholzer changed the title 🚨 Enable running clang-tidy for the MLIR subproject and switch to LLVM@20 🚨 Run clang-tidy on MLIR subproject, switch to LLVM@20, and update to CMake >= 3.24 Mar 21, 2025
@burgholzer burgholzer added extensive-cpp-ci Adding this label indicates that extensive C++ CI runs should be started for this PR. Core Anything related to the Core library and IR labels Mar 21, 2025
the latest Ubuntu LTS version 24.04 ships with 3.28 so we should be good.

Signed-off-by: burgholzer <[email protected]>
…CoreIR library

privately linking to the `project_options` does not propagte the feature requirement to the interface properties of the linked target, which is undesired. Everyone linking against our libraries will almost surely have to have C++ 17 support.

Signed-off-by: burgholzer <[email protected]>
this was revealed as part of enabling `CMAKE_VERIFY_INTERFACE_HEADER_SETS`

Signed-off-by: burgholzer <[email protected]>
also removes the legacy `QFRException` class and moves some methods from the `ir/Definitions` file to a more suitable place.

Signed-off-by: burgholzer <[email protected]>
… enable interface header verification

Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Anything related to C++ code code quality Code quality improvements continuous integration Anything related to the CI setup Core Anything related to the Core library and IR dependencies Pull requests that update a dependency file extensive-cpp-ci Adding this label indicates that extensive C++ CI runs should be started for this PR. MLIR Anything related to MLIR
Projects
Status: In Progress
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant