Centralized C++ quality tool policies for Eclipse S-CORE, providing sanitizer configurations and clang-tidy integration reusable across all S-CORE modules (logging, communication, baselibs, etc.).
Planned: clang-format, code coverage policies.
sanitizers/— ASan/UBSan/LSan/TSan Bazelcc_features, ready-to-use--config=aliases, suppression files, andtarget_compatible_withconstraints.clang_tidy/— centralized.clang-tidybaseline (conservative, tailorable per module) and a--config=clang-tidyBazel integration.
| Config | Sanitizers | Notes |
|---|---|---|
--config=asan |
AddressSanitizer | Memory errors, buffer overflows |
--config=ubsan |
UndefinedBehaviorSanitizer | Integer overflow, null deref |
--config=lsan |
LeakSanitizer | Memory leaks |
--config=tsan |
ThreadSanitizer | Data races, deadlocks — cannot combine with ASan/LSan |
--config=asan_ubsan_lsan |
ASan + UBSan + LSan | Recommended default for CI |
--config=tsan_ubsan |
TSan + UBSan | Threading + undefined behavior |
| Combination | Valid? | Notes |
|---|---|---|
| ASan + UBSan | ✅ Yes | Standard — included in --config=asan_ubsan_lsan |
| ASan + LSan | ✅ Yes | Included in --config=asan_ubsan_lsan |
| TSan + UBSan | ✅ Yes | Use --config=tsan_ubsan |
| ASan + TSan | ❌ No | Incompatible runtime libraries (libasan vs libtsan) |
| LSan + TSan | ❌ No | TSan has built-in leak detection; enabling both causes runtime conflicts |
Invalid combinations are enforced at three layers, strongest first:
- Feature level (primary) — the sanitizer
cc_features declaremutually_exclusivecategories (asan_tsan,lsan_tsan), so enablingscore_asan+score_tsanorscore_lsan+score_tsanthrough the toolchain fails at analysis time with an explicit error (Symbol ...:asan_tsan is provided by all of the following features: score_asan score_tsan). This protection is intrinsic to feature resolution and applies to every consumer automatically — no extra build-graph dependency required. - Bazel build target (secondary) — the
//sanitizers/flags:sanitizer_combination_checkgenrule catches the flag-driven path and prints an actionable message. The CI test suite depends on it automatically. - Compiler level (backstop) — Clang emits an explicit error (e.g.
error: invalid argument '-fsanitize=address' combined with '-fsanitize=thread').
bazel_dep(name = "score_cpp_policies")Copy sanitizers/sanitizers.bazelrc into your repository's .bazelrc.
bazel test --config=asan_ubsan_lsan //... # recommended default for CISee sanitizers/README.md for setup, the full config/constraint
reference, and the v0.x migration guide.
Centralized .clang-tidy check set and a --config=clang-tidy Bazel integration via
aspect_rules_lint.
See clang_tidy/README.md for the 8-step setup guide.
cd tests
bazel test --config=asan_ubsan_lsan //...
bazel test --config=tsan //...
bazel test --config=clang-tidy //...See CONTRIBUTION.md for guidelines. All commits must follow Eclipse Foundation commit rules. Contributors must sign the ECA and DCO.
Apache License 2.0 — see LICENSE for details.