Skip to content

Commit ecc9bb4

Browse files
♻️ Modernized the CMake build setup (#898)
* 🔧 Disable system header warnings * 📝 Add modernization plan * 🙈 Extend `.gitignore` * ✏️ Fix typo * 🔧 Add `pytest-xdist` for parallel Python test execution and `pytest-sugar` for prettified test output * 🔧 Modernize CMake calls in workflows * 🔧 Add missing CMake flag * ♻️ Modernize CLI CMake config * ♻️ Modernize test CMake config * ♻️ Modernize include CMake config * ♻️ Modernize installation CMake config and add dedicated target stripping function * ♻️ Introduce CMake presets * ♻️ Moved from git submodules to CMake's `FetchContent` * ♻️ Moved from git submodules to CMake's `FetchContent` * 🔧 Allow other CMake projects to find fiction * 🔧 Bump supported CMake version * 🔧 Improve clang-tidy integration * 🐛 Fix subtle bug in `fanout_substitution` * 🔥 Remove support for CUDA compilers * 🔧 Further build optimizations through CMake * 🙈 Update `.gitignore` * 🔧 Added useful pre-commit checks * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <actions@github.com> * 📝 Added CHANGELOG entry * 💚 Fix CI * ⬆️ Upgrade Z3 to version 4.15.4 * 💚 Fix CMake config typo * ✏️ Fix leftover `libs/` after refactoring * 🔥 Remove redundant CMake config * ✏️ Fix more leftover `libs/` * 💚 Don't clone submodules * 💚 Fix compilation error after pre-commit artifacts * 🔧 Update `pytest` and related dependencies * 💚 Replace leftover macOS-13 tag * 💚 Ignore old paths to not fail CI * 💚 Replace `libs` with `vendors` * 💚 Move helpers to anonymous namespaces to fix linker issues * 💚 Try `ignore` instead of `ignore-tidy` * 🚨 Fixed clang-tidy warnings * 🚨 Fixed clang-tidy warnings * 💚 Fix build error * 💚 Fix build errors and compiler warnings * 💚 Fix build errors * 🚨 Fix `clang-tidy` warnings * 🚨 Fix `clang-tidy` warnings * 🚨 Better suppression of compiler warnings from system headers * ⏪ Revert system-specific optimizations due to test failures * ⏪ Revert test case binary organization back to multi-binary builds * 🔧 Upgrade target macOS version for wheels from 11.0 to 13.0 * 🔧 Improve uv build caching by removing unconditional `reinstall-package` and configuring dedicated `cache-keys` * 🚨 Fix `clang-tidy` warnings * 🚨 Replace `std::numeric_limits<double>::infinity()` with `std::numeric_limits<double>::max()` due to the compiler flag `-ffinite-math-only` * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <actions@github.com> * 🚨 Fix `clang-tidy` warnings * 🚨 Fix `clang-tidy` warnings * 🐛 Replace `std::isinf` checks with `WithinAbs` comparisons using `std::numeric_limits<double>::max()` * ⏪ Revert `std::numeric_limits<double>::max()` back to `std::numeric_limits<double>::infinity()` for semantic reasons and remove the `-ffinite-math-only` compiler optimization * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <actions@github.com> * 🚨 Fix `clang-tidy` warnings * 🚨 Fix `clang-tidy` warnings * 🏗️ Refactor the ALGLIB downloader for better reliability * 💚 Fix build errors * 💚 Enhance ALGLIB fetching process with manual extraction and preparation * 💚 Significantly simplify the ALGLIB fetching and make it more reliable by hosting our own mirror * 💚 Remove coverage specification from `noxfile.py` * 👷 Deactivate PCH and Unity Builds in CI and limit parallelism * ⬇️ Downgrade Z3 to ensure ABI compatibility * 💚 Fix `jemalloc` building from source * 🔥 Remove verbose comments * 🚨 Fix `clang-tidy` warnings * 📌 Streamline Z3 versions across all configurations * 🔥 Remove planning document * ✏️ Remove remaining mentions of the `libs/` folder * 📝 Update CHANGELOG * 🔒 Updated lockfile * 💚 Reinsert `libs/*` check into the `clang-tidy` CI to prevent deleted files check in this PR --------- Signed-off-by: GitHub Actions <actions@github.com> Signed-off-by: Marcel Walter <marcel.walter@tum.de> Co-authored-by: GitHub Actions <actions@github.com>
1 parent 3d0f07f commit ecc9bb4

File tree

209 files changed

+12581
-9750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+12581
-9750
lines changed

.gitattributes

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ benchmarks/fontes18/* linguist-vendored
66
benchmarks/trindade16/* linguist-vendored
77
*.v linguist-detectable=false
88
*.fs linguist-detectable=false
9-
libs/* linguist-detectable=false
10-
libs/combinations/* linguist-detectable=false
11-
libs/graph-coloring/* linguist-detectable=false
12-
libs/mugen/* linguist-detectable=false
13-
libs/undirected_graph/* linguist-detectable=false
9+
vendors/* linguist-detectable=false
10+
vendors/combinations/* linguist-detectable=false
11+
vendors/graph-coloring/* linguist-detectable=false
12+
vendors/mugen/* linguist-detectable=false
13+
vendors/undirected_graph/* linguist-detectable=false

.github/workflows/clang-tidy-review.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919
pull-requests: write
2020

2121
env:
22-
Z3_VERSION: 4.13.0
22+
Z3_VERSION: 4.13.4
2323

2424
jobs:
2525
clangtidy:
@@ -30,7 +30,6 @@ jobs:
3030
- name: Clone Repository
3131
uses: actions/checkout@v6
3232
with:
33-
submodules: recursive
3433
fetch-depth: 0
3534

3635
- name: Install dependencies
@@ -57,6 +56,7 @@ jobs:
5756
-DFICTION_PROGRESS_BARS=ON
5857
-DFICTION_Z3=ON
5958
-DFICTION_ENABLE_MUGEN=ON
59+
-DFICTION_PYTHON_BINDINGS=ON
6060
-DFICTION_ALGLIB=ON
6161
-DFICTION_ENABLE_MUGEN=ON
6262
-DMOCKTURTLE_EXAMPLES=OFF
@@ -72,7 +72,7 @@ jobs:
7272
database: "build"
7373
step-summary: true
7474
thread-comments: ${{ ((github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork) && 'update') || 'false' }}
75-
ignore-tidy: "build|libs/*|docs/*|benchmarks/*|bib/*|bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp|bindings/mnt/pyfiction/include/pyfiction/documentation.hpp"
75+
ignore: "build|libs/*|vendors/*|docs/*|benchmarks/*|bib/*|bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp|bindings/mnt/pyfiction/include/pyfiction/documentation.hpp"
7676
version: "21"
7777

7878
- if: steps.linter.outputs.checks-failed > 0

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
- "**/*.cmake"
1010
- "**/CMakeLists.txt"
1111
- "**/*.py"
12-
- "libs/**"
1312
- ".github/workflows/codeql-analysis.yml"
1413
- "!bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp"
1514
pull_request:
@@ -20,7 +19,6 @@ on:
2019
- "**/*.cmake"
2120
- "**/CMakeLists.txt"
2221
- "**/*.py"
23-
- "libs/**"
2422
- ".github/workflows/codeql-analysis.yml"
2523
- "!bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp"
2624
merge_group:
@@ -32,7 +30,7 @@ concurrency:
3230
cancel-in-progress: true
3331

3432
env:
35-
Z3_VERSION: 4.13.0
33+
Z3_VERSION: 4.13.4
3634

3735
jobs:
3836
analyze:
@@ -68,7 +66,6 @@ jobs:
6866
- name: Checkout repository
6967
uses: actions/checkout@v6
7068
with:
71-
submodules: recursive
7269
fetch-depth: 0
7370

7471
- name: Setup ccache
@@ -91,7 +88,7 @@ jobs:
9188
- name: Install pip packages
9289
uses: BSFishy/pip-action@v1
9390
with:
94-
requirements: ${{github.workspace}}/libs/mugen/requirements.txt
91+
requirements: ${{github.workspace}}/vendors/mugen/requirements.txt
9592

9693
- name: Setup Z3 Solver
9794
id: z3
@@ -110,19 +107,12 @@ jobs:
110107
languages: ${{ matrix.language }}
111108
config-file: .github/codeql-config.yml
112109

113-
- if: matrix.language == 'cpp'
114-
name: Create Build Environment
115-
run: cmake -E make_directory ${{github.workspace}}/build
116-
117110
- if: matrix.language == 'cpp'
118111
name: Configure CMake
119-
working-directory: ${{github.workspace}}/build
120112
run: >
121-
cmake ${{github.workspace}}
113+
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build
122114
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
123115
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
124-
-DFICTION_ENABLE_UNITY_BUILD=ON
125-
-DFICTION_ENABLE_PCH=ON
126116
-DFICTION_CLI=OFF
127117
-DFICTION_TEST=ON
128118
-DFICTION_BENCHMARK=OFF
@@ -136,8 +126,7 @@ jobs:
136126
137127
- if: matrix.language == 'cpp'
138128
name: Build fiction
139-
working-directory: ${{github.workspace}}/build
140-
run: cmake --build . --config ${{matrix.build_type}} -j4
129+
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} --parallel 4
141130

142131
- name: Perform CodeQL Analysis
143132
uses: github/codeql-action/analyze@v4
@@ -149,7 +138,7 @@ jobs:
149138
uses: advanced-security/filter-sarif@main
150139
with:
151140
patterns: |
152-
-**/libs/**
141+
-**/vendors/**
153142
-**/docs/**
154143
-**/experiments/**
155144
input: sarif-results/${{ matrix.language }}.sarif

.github/workflows/coverage.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- "**/*.cpp"
99
- "**/*.cmake"
1010
- "**/CMakeLists.txt"
11-
- "libs/**"
1211
- ".github/workflows/coverage.yml"
1312
- "!bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp"
1413
pull_request:
@@ -18,7 +17,6 @@ on:
1817
- "**/*.cpp"
1918
- "**/*.cmake"
2019
- "**/CMakeLists.txt"
21-
- "libs/**"
2220
- ".github/workflows/coverage.yml"
2321
- "!bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp"
2422
merge_group:
@@ -33,7 +31,7 @@ defaults:
3331

3432
env:
3533
BUILD_TYPE: Debug
36-
Z3_VERSION: 4.13.0
34+
Z3_VERSION: 4.13.4
3735

3836
jobs:
3937
build_and_test:
@@ -51,8 +49,6 @@ jobs:
5149

5250
- name: Clone Repository
5351
uses: actions/checkout@v6
54-
with:
55-
submodules: recursive
5652

5753
- name: Setup ccache
5854
uses: hendrikmuhs/ccache-action@v1.2
@@ -74,7 +70,7 @@ jobs:
7470
- name: Install pip packages
7571
uses: BSFishy/pip-action@v1
7672
with:
77-
requirements: ${{github.workspace}}/libs/mugen/requirements.txt
73+
requirements: ${{github.workspace}}/vendors/mugen/requirements.txt
7874

7975
- name: Setup Z3 Solver
8076
id: z3
@@ -91,11 +87,10 @@ jobs:
9187
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -G Ninja
9288
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
9389
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
94-
-DFICTION_ENABLE_UNITY_BUILD=ON
95-
-DFICTION_ENABLE_PCH=ON
9690
-DFICTION_CLI=OFF
9791
-DFICTION_TEST=ON
9892
-DFICTION_BENCHMARK=OFF
93+
-DFICTION_EXPERIMENTS=OFF
9994
-DFICTION_Z3=ON
10095
-DFICTION_ALGLIB=ON
10196
-DFICTION_ENABLE_MUGEN=ON
@@ -105,11 +100,11 @@ jobs:
105100
-DMOCKTURTLE_EXAMPLES=OFF
106101
107102
- name: Build
108-
run: cmake --build ${{github.workspace}}/build --config $BUILD_TYPE --parallel
103+
run: cmake --build ${{github.workspace}}/build --config $BUILD_TYPE --parallel 4
109104

110105
- name: Test
111106
working-directory: ${{github.workspace}}/build
112-
run: ctest -C $BUILD_TYPE --output-on-failure --repeat until-pass:3 --parallel
107+
run: ctest -C $BUILD_TYPE --output-on-failure --repeat until-pass:3 --parallel 4
113108

114109
- name: Generate Coverage Report
115110
run: |

.github/workflows/macos.yml

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- "**/*.cpp"
99
- "**/*.cmake"
1010
- "**/CMakeLists.txt"
11-
- "libs/**"
1211
- ".github/workflows/macos.yml"
1312
- "!bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp"
1413
pull_request:
@@ -18,7 +17,6 @@ on:
1817
- "**/*.cpp"
1918
- "**/*.cmake"
2019
- "**/CMakeLists.txt"
21-
- "libs/**"
2220
- ".github/workflows/macos.yml"
2321
- "!bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp"
2422
merge_group:
@@ -32,7 +30,7 @@ defaults:
3230
shell: bash
3331

3432
env:
35-
Z3_VERSION: 4.13.0
33+
Z3_VERSION: 4.13.4
3634

3735
jobs:
3836
build_and_test:
@@ -47,8 +45,6 @@ jobs:
4745
steps:
4846
- name: Clone Repository
4947
uses: actions/checkout@v6
50-
with:
51-
submodules: recursive
5248

5349
- name: Setup Python
5450
uses: actions/setup-python@v6
@@ -77,17 +73,12 @@ jobs:
7773
version: ${{env.Z3_VERSION}}
7874

7975
# Build and test pipeline for Debug mode
80-
- name: Create Build Environment (Debug)
81-
run: cmake -E make_directory ${{github.workspace}}/build_debug
8276

8377
- name: Configure CMake (Debug)
84-
working-directory: ${{github.workspace}}/build_debug
8578
run: >
86-
cmake ${{github.workspace}}
79+
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build_debug
8780
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
8881
-DCMAKE_BUILD_TYPE=Debug
89-
-DFICTION_ENABLE_UNITY_BUILD=ON
90-
-DFICTION_ENABLE_PCH=ON
9182
-DFICTION_CLI=ON
9283
-DFICTION_TEST=ON
9384
-DFICTION_BENCHMARK=OFF
@@ -99,25 +90,18 @@ jobs:
9990
-DMOCKTURTLE_EXAMPLES=OFF
10091
10192
- name: Build (Debug)
102-
working-directory: ${{github.workspace}}/build_debug
103-
run: cmake --build . --config Debug -j4 # all macOS runners provide at least 3 cores
93+
run: cmake --build ${{github.workspace}}/build_debug --config Debug --parallel 3
10494

10595
- name: Test (Debug)
106-
working-directory: ${{github.workspace}}/build_debug
107-
run: ctest -C Debug --verbose --output-on-failure --repeat until-pass:3 --parallel 4
96+
run: ctest --test-dir ${{github.workspace}}/build_debug -C Debug --verbose --output-on-failure --repeat until-pass:3 --parallel 3
10897

10998
# Build and test pipeline for Release mode
110-
- name: Create Build Environment (Release)
111-
run: cmake -E make_directory ${{github.workspace}}/build_release
11299

113100
- name: Configure CMake (Release)
114-
working-directory: ${{github.workspace}}/build_release
115101
run: >
116-
cmake ${{github.workspace}}
102+
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build_release
117103
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
118104
-DCMAKE_BUILD_TYPE=Release
119-
-DFICTION_ENABLE_UNITY_BUILD=ON
120-
-DFICTION_ENABLE_PCH=ON
121105
-DFICTION_ENABLE_JEMALLOC=ON
122106
-DFICTION_CLI=ON
123107
-DFICTION_TEST=ON
@@ -130,9 +114,7 @@ jobs:
130114
-DMOCKTURTLE_EXAMPLES=OFF
131115
132116
- name: Build (Release)
133-
working-directory: ${{github.workspace}}/build_release
134-
run: cmake --build . --config Release -j4 # all macOS runners provide at least 3 cores
117+
run: cmake --build ${{github.workspace}}/build_release --config Release --parallel 3
135118

136119
- name: Test (Release)
137-
working-directory: ${{github.workspace}}/build_release
138-
run: ctest -C Release --verbose --output-on-failure --repeat until-pass:3 --parallel 4
120+
run: ctest --test-dir ${{github.workspace}}/build_release -C Release --verbose --output-on-failure --repeat until-pass:3 --parallel 3

.github/workflows/pyfiction-docstring-generator.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
- name: Clone Repository
1616
uses: actions/checkout@v6
1717
with:
18-
submodules: recursive
1918
fetch-depth: 0 # Fetch all history for all branches and tags
2019

2120
- name: Setup Python

.github/workflows/pyfiction-pypi-deployment.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ on:
1515
- "**/*.cpp"
1616
- "**/*.cmake"
1717
- "**/CMakeLists.txt"
18-
- "libs/**"
1918
- "noxfile.py"
2019
- "pyproject.toml"
21-
- ".uv.lock"
20+
- "uv.lock"
2221
- ".github/workflows/pyfiction-pypi-deployment.yml"
2322
pull_request:
2423
branches: ["main"]
@@ -29,10 +28,9 @@ on:
2928
- "**/*.cpp"
3029
- "**/*.cmake"
3130
- "**/CMakeLists.txt"
32-
- "libs/**"
3331
- "noxfile.py"
3432
- "pyproject.toml"
35-
- ".uv.lock"
33+
- "uv.lock"
3634
- ".github/workflows/pyfiction-pypi-deployment.yml"
3735
workflow_dispatch:
3836
workflow_run:
@@ -50,17 +48,16 @@ concurrency:
5048
cancel-in-progress: true
5149

5250
env:
53-
Z3_VERSION: 4.13.0
51+
Z3_VERSION: 4.13.4
5452

5553
jobs:
5654
build_sdist:
5755
name: 📦 Build Source Distribution
5856
runs-on: ubuntu-latest
5957
steps:
60-
- name: Clone respository
58+
- name: Clone repository
6159
uses: actions/checkout@v6
6260
with:
63-
submodules: recursive
6461
fetch-depth: 0
6562

6663
- name: Install the latest version of uv

.github/workflows/python-bindings.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ on:
1010
- "**/*.cpp"
1111
- "**/*.cmake"
1212
- "**/CMakeLists.txt"
13-
- "libs/**"
1413
- "noxfile.py"
1514
- "pyproject.toml"
16-
- ".uv.lock"
15+
- "uv.lock"
1716
- ".github/workflows/python-bindings.yml"
1817
pull_request:
1918
branches: ["main"]
@@ -24,10 +23,9 @@ on:
2423
- "**/*.cpp"
2524
- "**/*.cmake"
2625
- "**/CMakeLists.txt"
27-
- "libs/**"
2826
- "noxfile.py"
2927
- "pyproject.toml"
30-
- ".uv.lock"
28+
- "uv.lock"
3129
- ".github/workflows/python-bindings.yml"
3230
workflow_run:
3331
workflows: ["pyfiction Docstring Generator"]
@@ -43,7 +41,7 @@ defaults:
4341
shell: bash
4442

4543
env:
46-
Z3_VERSION: 4.13.0
44+
Z3_VERSION: 4.13.4
4745

4846
jobs:
4947
python-tests:
@@ -52,12 +50,11 @@ jobs:
5250
strategy:
5351
fail-fast: false
5452
matrix:
55-
runs-on: [ubuntu-latest, macos-13, macos-15, windows-latest]
53+
runs-on: [ubuntu-latest, macos-latest, windows-latest]
5654
steps:
5755
- name: Clone Repository
5856
uses: actions/checkout@v6
5957
with:
60-
submodules: recursive
6158
fetch-depth: 0
6259

6360
- name: Setup ccache

0 commit comments

Comments
 (0)