Skip to content

Commit

Permalink
apacheGH-45206: [C++][CMake] Add sanitizer presets (apache#45207)
Browse files Browse the repository at this point in the history
### Rationale for this change

See apache#45206

### What changes are included in this PR?

Add base presets for ASAN/TSAN/UBSAN. And cross product such base presets by `ninja-debug` which is, IMO, the config just enough necessary and likely to need sanitizers' aid. 

### Are these changes tested?

No need.

### Are there any user-facing changes?

None.

* GitHub Issue: apache#45206

Authored-by: Rossi Sun <[email protected]>
Signed-off-by: Rossi Sun <[email protected]>
  • Loading branch information
zanmato1984 authored Jan 9, 2025
1 parent 4ede48c commit f57c37a
Showing 1 changed file with 59 additions and 3 deletions.
62 changes: 59 additions & 3 deletions cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,33 @@
"ARROW_TEST_MEMCHECK": "ON"
}
},
{
"name": "sanitizer-asan",
"hidden": true,
"cacheVariables": {
"ARROW_USE_ASAN": "ON",
"ARROW_JEMALLOC": "OFF",
"ARROW_MIMALLOC": "OFF"
}
},
{
"name": "sanitizer-tsan",
"hidden": true,
"cacheVariables": {
"ARROW_USE_TSAN": "ON",
"ARROW_JEMALLOC": "OFF",
"ARROW_MIMALLOC": "OFF"
}
},
{
"name": "sanitizer-ubsan",
"hidden": true,
"cacheVariables": {
"ARROW_USE_UBSAN": "ON",
"ARROW_JEMALLOC": "OFF",
"ARROW_MIMALLOC": "OFF"
}
},
{
"name": "ninja-debug-minimal",
"inherits": [
Expand Down Expand Up @@ -527,16 +554,45 @@
"displayName": "Benchmarking build with everything enabled",
"cacheVariables": {}
},
{
"name": "ninja-debug-asan",
"inherits": [
"ninja-debug",
"sanitizer-asan"
],
"displayName": "Debug ASAN build with tests and more optional components",
"cacheVariables": {}
},
{
"name": "ninja-debug-tsan",
"inherits": [
"ninja-debug",
"sanitizer-tsan"
],
"displayName": "Debug TSAN build with tests and more optional components",
"cacheVariables": {}
},
{
"name": "ninja-debug-ubsan",
"inherits": [
"ninja-debug",
"sanitizer-ubsan"
],
"displayName": "Debug UBSAN build with tests and more optional components",
"cacheVariables": {}
},
{
"name": "fuzzing",
"inherits": "base",
"inherits": [
"base",
"sanitizer-asan",
"sanitizer-ubsan"
],
"displayName": "Debug build with IPC and Parquet fuzzing targets",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"ARROW_USE_ASAN": "ON",
"ARROW_USE_UBSAN": "ON",
"ARROW_IPC": "ON",
"ARROW_PARQUET": "ON",
"ARROW_FUZZING": "ON"
Expand Down

0 comments on commit f57c37a

Please sign in to comment.