Add CMake presets
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 876
- Forks
- 260
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 157
Description
We have a collection of sensible build targets, represented by the different jobs in the CI (eg: normal, debug, clang-tidy, ASAN, TSAN). Each includes some common args (`-GNinja`), some explicit args for the target build type (`-DTSAN=ON`), and some further flags to support this (eg excluding other features `-DUSE_SNMALLOC=OFF`, enabling other features `-DWORKER_THREADS=2`, disabling slow tests `-DLONG_TESTS=OFF`).
If one of these fails in CI, and you want to repro locally, you _might_ need _exactly the same arguments_. Currently that's done by finding the correct bit of YAML and copy-pasting.
I think [CMake Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) solve this in a cleaner way. So we'd create a `CMakePreset.json` specifying these arguments, and then can simply call `cmake --preset TSAN` either locally or in the CI, to get a consistent collection of args (and metadata and flags and who knows what else might be useful).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the existing CI job YAML for normal, debug, clang-tidy, ASAN, and TSAN builds, including their CMake arguments and flags. Define the corresponding presets in CMakePreset.json so local and CI runs can use commands such as cmake --preset TSAN, and verify that each preset reproduces its existing job configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, ci-cd
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100