From 3135022a282e69ac8c97b32a70c562d65fa81f86 Mon Sep 17 00:00:00 2001 From: rahulsasingh Date: Mon, 29 Jun 2026 06:13:55 +0000 Subject: [PATCH] adopt score_cpp_policies presets via bazelrc-preset.bzl --- .bazelrc | 55 +++---- MODULE.bazel | 7 +- MODULE.bazel.lock | 3 + tools/BUILD.bazel | 21 +++ tools/preset.bazelrc | 342 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 391 insertions(+), 37 deletions(-) create mode 100644 tools/BUILD.bazel create mode 100644 tools/preset.bazelrc diff --git a/.bazelrc b/.bazelrc index a97c3019..c2586561 100644 --- a/.bazelrc +++ b/.bazelrc @@ -11,6 +11,9 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* +# Sanitizer and clang-tidy flags from score_cpp_policies +import %workspace%/tools/preset.bazelrc + build --java_language_version=17 build --tool_java_language_version=17 build --java_runtime_version=remotejdk_17 @@ -111,43 +114,25 @@ coverage --cxxopt=-fprofile-update=atomic # Dynamic analysis (sanitizers) for Linux host builds/tests # ============================================================================== -# Debug symbols for sanitizer stack traces -test:with_debug_symbols --cxxopt=-g1 -test:with_debug_symbols --strip=never - -# AddressSanitizer + UndefinedBehaviorSanitizer + LeakSanitizer (Combined) -build:asan_ubsan_lsan --config=x86_64-linux -build:asan_ubsan_lsan --features=asan -build:asan_ubsan_lsan --features=ubsan -build:asan_ubsan_lsan --features=lsan -build:asan_ubsan_lsan --platform_suffix=asan_ubsan_lsan -test:asan_ubsan_lsan --config=with_debug_symbols +# FIXME: GCC-only workaround until score_gcc_x86_64_toolchain registers +# score_cpp_policies' sanitizer features via extra_known_features — blocked on +# eclipse-score/bazel_cpp_toolchains#52. +build:asan --config=x86_64-linux +build:asan --features=asan +build:ubsan --config=x86_64-linux +build:ubsan --features=ubsan +build:lsan --config=x86_64-linux +build:lsan --features=lsan +build:tsan --config=x86_64-linux +build:tsan --features=tsan + test:asan_ubsan_lsan --test_tag_filters=-no-asan,-no-lsan,-no-ubsan -test:asan_ubsan_lsan --@score_cpp_policies//sanitizers/flags:sanitizer=asan_ubsan_lsan -test:asan_ubsan_lsan --run_under=@score_cpp_policies//sanitizers:wrapper - -# Shortcuts for individual sanitizers -build:asan --config=asan_ubsan_lsan -test:asan --test_tag_filters=-no-asan -build:ubsan --config=asan_ubsan_lsan -test:ubsan --test_tag_filters=-no-ubsan -build:lsan --config=asan_ubsan_lsan -test:lsan --test_tag_filters=-no-lsan - -# ThreadSanitizer (cannot be combined with ASan/LSan) -build:tsan --config=x86_64-linux -build:tsan --features=tsan -build:tsan --platform_suffix=tsan +test:asan --test_tag_filters=-no-asan +test:ubsan --test_tag_filters=-no-ubsan +test:lsan --test_tag_filters=-no-lsan +test:tsan --test_tag_filters=-no-tsan + # GCC 12 promotes TSan limitation on atomic_thread_fence to -Werror=tsan. # Downgrade to warning so external deps (score_baselibs) compile; TSan still runs. build:tsan --cxxopt=-Wno-error=tsan -test:tsan --config=with_debug_symbols test:tsan --cxxopt=-O1 -test:tsan --test_tag_filters=-no-tsan -test:tsan --@score_cpp_policies//sanitizers/flags:sanitizer=tsan -test:tsan --run_under=@score_cpp_policies//sanitizers:wrapper - -# Clang-tidy: bazel test --config=clang-tidy //score/... -test:clang-tidy --aspects=//tools/lint:linters.bzl%clang_tidy_aspect -test:clang-tidy --output_groups=+rules_lint_report -test:clang-tidy --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux diff --git a/MODULE.bazel b/MODULE.bazel index 2a5be57d..b768fb85 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -24,12 +24,15 @@ bazel_dep(name = "rules_cc", version = "0.2.17") bazel_dep(name = "aspect_rules_lint", version = "2.5.0") bazel_dep(name = "score_cpp_policies", version = "0.0.0", dev_dependency = True) + +# FIXME: pinned to score_cpp_policies#13, switch to upstream once merged. git_override( module_name = "score_cpp_policies", - commit = "b6551c217fbb0daf948b493c4ba69eb7fe8359a5", - remote = "https://github.com/eclipse-score/score_cpp_policies.git", + commit = "b2bec2a914d358606aac3fc29f861a63ce1a5d92", + remote = "https://github.com/RSingh1511/score_cpp_policies.git", ) +bazel_dep(name = "bazelrc-preset.bzl", version = "1.9.2", dev_dependency = True) bazel_dep(name = "toolchains_llvm", version = "1.7.0", dev_dependency = True) bazel_dep(name = "buildifier_prebuilt", version = "8.5.1") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 7e4c59cb..bdcbb6ec 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -101,6 +101,8 @@ "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7", "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0", + "https://bcr.bazel.build/modules/bazelrc-preset.bzl/1.9.2/MODULE.bazel": "9354bc3d91ee66e804642419af601b853e3228f6493f9263d51c5cd7b25c2a55", + "https://bcr.bazel.build/modules/bazelrc-preset.bzl/1.9.2/source.json": "d78791185eae5a8af3a5793f312f0ba21185bd8a115b9419fb99527d03ab112b", "https://bcr.bazel.build/modules/boost.any/1.83.0.bcr.4/MODULE.bazel": "b0dd78068b3d4b509e7d2cbafc498687ac347621e303bec26312f63baee1c97d", "https://bcr.bazel.build/modules/boost.any/1.83.0.bcr.4/source.json": "0b0e71cc436ae601b4ecacf85c7246866c6d39178af0689906b9b997890f984d", "https://bcr.bazel.build/modules/boost.array/1.83.0.bcr.4/MODULE.bazel": "419a97f36e8cc9cc75a783707051d51e6eaa88f49fda575811c78c76885f097a", @@ -605,6 +607,7 @@ "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/bazel_skylib/1.8.1/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/bazel_skylib/1.8.2/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/bazel_skylib/1.9.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/bazelrc-preset.bzl/1.9.2/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/boost.any/1.83.0.bcr.4/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/boost.array/1.83.0.bcr.4/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/boost.assert/1.83.0.bcr.4/MODULE.bazel": "not found", diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel new file mode 100644 index 00000000..4c9f8fc0 --- /dev/null +++ b/tools/BUILD.bazel @@ -0,0 +1,21 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load("@bazelrc-preset.bzl", "bazelrc_preset") +load("@score_cpp_policies//:presets.bzl", "PRESETS") + +# Generates tools/preset.bazelrc, imported by the root .bazelrc. +bazelrc_preset( + name = "preset", + extra_presets = PRESETS, +) diff --git a/tools/preset.bazelrc b/tools/preset.bazelrc new file mode 100644 index 00000000..76b118d9 --- /dev/null +++ b/tools/preset.bazelrc @@ -0,0 +1,342 @@ +# Generated by bazelrc-preset.bzl +# To update this file, run: +# bazel run @@//tools:preset.update + +# On CI, announce all announces command options read from the bazelrc file(s) when starting up at the +# beginning of each Bazel invocation. This is very useful on CI to be able to inspect which flags +# are being applied on each run based on the order of overrides. +common:ci --announce_rc +# Docs: https://registry.build/flag/bazel@8.3.0?filter=announce_rc + +# Avoid creating a runfiles tree for binaries or tests until it is needed. +# See https://github.com/bazelbuild/bazel/issues/6627 +# This may break local workflows that `build` a binary target, then run the resulting program outside of `bazel run`. +# In those cases, the script will need to call `bazel build --build_runfile_links //my/binary:target` and then execute the resulting program. +common --nobuild_runfile_links +# Docs: https://registry.build/flag/bazel@8.3.0?filter=build_runfile_links + +# Always run tests even if they have cached results. +# This ensures tests are executed fresh each time, useful for debugging and ensuring test reliability. +common:debug --nocache_test_results +# Docs: https://registry.build/flag/bazel@8.3.0?filter=cache_test_results + +# Don’t encourage a rules author to update their deps if not needed. +# These bazel_dep calls should indicate the minimum version constraint of the ruleset. +# If the author instead updates to the newest of any of their transitives, as this flag would suggest, +# then they'll also force their dependents to a newer version. +# Context: +# https://bazelbuild.slack.com/archives/C014RARENH0/p1691158021917459?thread_ts=1691156601.420349&cid=C014RARENH0 +common:ruleset --check_direct_dependencies="off" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=check_direct_dependencies + +# On CI, use colors to highlight output on the screen. Set to `no` if your CI does not display colors. +common:ci --color="yes" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=color + +# On CI, use cursor controls in screen output. +common:ci --curses="yes" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=curses + +# Bazel picks up host-OS-specific config lines from bazelrc files. For example, if the host OS is +# Linux and you run bazel build, Bazel picks up lines starting with build:linux. Supported OS +# identifiers are `linux`, `macos`, `windows`, `freebsd`, and `openbsd`. Enabling this flag is +# equivalent to using `--config=linux` on Linux, `--config=windows` on Windows, etc. +common --enable_platform_specific_config +# Docs: https://registry.build/flag/bazel@8.3.0?filter=enable_platform_specific_config + +# Speed up all builds by not checking if external repository files have been modified. +# For reference: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java#L244 +common --noexperimental_check_external_repository_files +# Docs: https://registry.build/flag/bazel@8.3.0?filter=experimental_check_external_repository_files + +# Always download coverage files for tests from the remote cache. By default, coverage files are not +# downloaded on test result cache hits when --remote_download_minimal is enabled, making it impossible +# to generate a full coverage report. +common --experimental_fetch_all_coverage_outputs +# Docs: https://registry.build/flag/bazel@8.3.0?filter=experimental_fetch_all_coverage_outputs + +# Set this flag to enable re-tries of failed tests on CI. +# When any test target fails, try one or more times. This applies regardless of whether the "flaky" +# tag appears on the target definition. +# This is a tradeoff: legitimately failing tests will take longer to report, +# but we can "paper over" flaky tests that pass most of the time. +# +# An alternative is to mark every flaky test with the `flaky = True` attribute, but this requires +# the buildcop to make frequent code edits. +# This flag is not recommended for local builds: flakiness is more likely to get fixed if it is +# observed during development. +# +# Note that when passing after the first attempt, Bazel will give a special "FLAKY" status rather than "PASSED". +test:ci --flaky_test_attempts=2 +# Docs: https://registry.build/flag/bazel@8.3.0?filter=flaky_test_attempts + +# Fixes builds hanging on CI that get the TCP connection closed without sending RST packets. +common:ci --grpc_keepalive_time="30s" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=grpc_keepalive_time + +# Output a heap dump if an OOM is thrown during a Bazel invocation +# (including OOMs due to `--experimental_oom_more_eagerly_threshold`). +# The dump will be written to `/.heapdump.hprof`. +# You should configure CI to upload this artifact for later inspection. +common --heap_dump_on_oom +# Docs: https://registry.build/flag/bazel@8.3.0?filter=heap_dump_on_oom + +# Allow the Bazel server to check directory sources for changes. Ensures that the Bazel server +# notices when a directory changes, if you have a directory listed in the srcs of some target. +# Recommended when using [copy_directory](https://github.com/bazel-contrib/bazel-lib/blob/main/docs/copy_directory.md) +# and [rules_js](https://github.com/aspect-build/rules_js) since npm package are source directories inputs to copy_directory actions. +startup --host_jvm_args="-DBAZEL_TRACK_SOURCE_DIRECTORIES=1" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=host_jvm_args + +# By default, Bazel automatically creates __init__.py files for py_binary and py_test targets. +# From https://github.com/bazelbuild/bazel/issues/10076: +# > It is magic at a distance. +# > Python programmers are already used to creating __init__.py files in their source trees, +# > so doing it behind their backs introduces confusion and changes the semantics of imports +common --incompatible_default_to_explicit_init_py +# Docs: https://registry.build/flag/bazel@8.3.0?filter=incompatible_default_to_explicit_init_py + +# Accept multiple --modify_execution_info flags, rather than the last flag overwriting earlier ones. +common --incompatible_modify_execution_info_additive +# Docs: https://registry.build/flag/bazel@8.3.0?filter=incompatible_modify_execution_info_additive + +# Make builds more reproducible by using a static value for PATH and not inheriting LD_LIBRARY_PATH. +# Use `--action_env=ENV_VARIABLE` if you want to inherit specific variables from the environment where Bazel runs. +# Note that doing so can prevent cross-user caching if a shared cache is used. +# See https://github.com/bazelbuild/bazel/issues/2574 for more details. +common --incompatible_strict_action_env +# Docs: https://registry.build/flag/bazel@8.3.0?filter=incompatible_strict_action_env + +# Fail the build if the MODULE.bazel.lock file is out of date. +# Using this mode in ci prevents the lockfile from being out of date. +common:ci --lockfile_mode="error" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=lockfile_mode + +# On CI, don't download remote outputs to the local machine. +# Most CI pipelines don't need to access the files and they can remain at rest on the remote cache. +# Significant time can be spent on needless downloads, which is especially noticeable on fully-cached builds. +# +# If you do need to download files, the fastest options are: +# - (preferred) Use `remote_download_regex` to specify the files to download. +# - Use the Remote Output Service (https://blog.bazel.build/2024/07/23/remote-output-service.html) +# to lazy-materialize specific files after the build completes. +# - Perform a second bazel command with specific targets and override this flag with the `toplevel` value. +# - To copy executable targets, you can use `bazel run --run_under=cp //some:binary_target `. +common:ci --remote_download_outputs="minimal" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=remote_download_outputs + +# On CI, fall back to standalone local execution strategy if remote execution fails. +# Otherwise, when a grpc remote cache connection fails, it would fail the build. +common:ci --remote_local_fallback +# Docs: https://registry.build/flag/bazel@8.3.0?filter=remote_local_fallback + +# On CI, extend the maximum amount of time to wait for remote execution and cache calls. +common:ci --remote_timeout=3600 +# Docs: https://registry.build/flag/bazel@8.3.0?filter=remote_timeout + +# Do not upload locally executed action results to the remote cache. +# This should be the default for local builds so local builds cannot poison the remote cache. +# +# Note that this flag is flipped to True under --config=ci, see below. +common --noremote_upload_local_results +# Docs: https://registry.build/flag/bazel@8.3.0?filter=remote_upload_local_results + +# On CI, upload locally executed action results to the remote cache. +common:ci --remote_upload_local_results +# Docs: https://registry.build/flag/bazel@8.3.0?filter=remote_upload_local_results + +# Repository rules, such as rules_jvm_external: put Bazel's JDK on the path. +# Avoids non-hermeticity from dependency on a JAVA_HOME pointing at a system JDK +# see https://github.com/bazelbuild/rules_jvm_external/issues/445 +common --repo_env="JAVA_HOME=../bazel_tools/jdk" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=repo_env + +# Reuse sandbox directories between invocations. +# Directories used by sandboxed non-worker execution may be reused to avoid unnecessary setup costs. +# Saves time on sandbox creation and deletion when many of the same kind of action is spawned during the build. +common --reuse_sandbox_directories +# Docs: https://registry.build/flag/bazel@8.3.0?filter=reuse_sandbox_directories + +# Don't allow network access for build actions in the sandbox by default. +# Avoids accidental non-hermeticity in actions/tests which depend on remote services. +# Developers should tag targets with `tags=["requires-network"]` to be explicit that they need network access. +# Note that the sandbox cannot print a message to the console if it denies network access, +# so failures under this flag appear as application errors in the networking layer. +common --nosandbox_default_allow_network +# Docs: https://registry.build/flag/bazel@8.3.0?filter=sandbox_default_allow_network + +# Only show progress every 60 seconds on CI. +# We want to find a compromise between printing often enough to show that the build isn't stuck, +# but not so often that we produce a long log file that requires a lot of scrolling. +common:ci --show_progress_rate_limit=60 +# Docs: https://registry.build/flag/bazel@8.3.0?filter=show_progress_rate_limit + +# The printed files are convenient strings for copy+pasting to the shell, to execute them. +# This option requires an integer argument, which is the threshold number of targets above which result information is not printed. +# Show the output files created by builds that requested more than one target. +# This helps users locate the build outputs in more cases. +common --show_result=20 +# Docs: https://registry.build/flag/bazel@8.3.0?filter=show_result + +# On CI, add a timestamp to each message generated by Bazel specifying the time at which the message was displayed. +# This makes it easier to reason about what were the slowest steps on CI. +common:ci --show_timestamps +# Docs: https://registry.build/flag/bazel@8.3.0?filter=show_timestamps + +# The terminal width in columns. Configure this to override the default value based on what your CI system renders. +common:ci --terminal_columns=143 +# Docs: https://registry.build/flag/bazel@8.3.0?filter=terminal_columns + +# Output test errors to stderr so users don't have to `cat` or open test failure log files when test fail. +# This makes the log noisier in exchange for reducing the time-to-feedback on test failures for users. +common --test_output="errors" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=test_output + +# Stream stdout/stderr output from each test in real-time. +# This provides immediate feedback during test execution, useful for debugging test failures. +common:debug --test_output="streamed" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=test_output + +# Run one test at a time in exclusive mode. +# This prevents test interference and provides clearer output when debugging test issues. +common:debug --test_strategy="exclusive" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=test_strategy + +# The default test_summary ("short") prints a result for every test target that was executed. +# In a large repo this amounts to hundreds of lines of additional log output when testing a broad wildcard pattern like //... +# This value means to print information only about unsuccessful tests that were run. +test:ci --test_summary="terse" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=test_summary + +# Prevent long running tests from timing out. +# Set to a high value to allow tests to complete even if they take longer than expected. +common:debug --test_timeout=9999 +# Docs: https://registry.build/flag/bazel@8.3.0?filter=test_timeout + +# Activate the ASan cc_feature (score_asan) for the //sanitizers/flags:asan_on config_setting. +build:asan --@score_cpp_policies//sanitizers/flags:asan +# Docs: https://registry.build/flag/bazel@8.3.0?filter=@score_cpp_policies//sanitizers/flags:asan + +# Activate the LSan cc_feature (score_lsan) for the //sanitizers/flags:lsan_on config_setting. +build:lsan --@score_cpp_policies//sanitizers/flags:lsan +# Docs: https://registry.build/flag/bazel@8.3.0?filter=@score_cpp_policies//sanitizers/flags:lsan + +# Activate the TSan cc_feature (score_tsan) for the //sanitizers/flags:tsan_on config_setting. +build:tsan --@score_cpp_policies//sanitizers/flags:tsan +# Docs: https://registry.build/flag/bazel@8.3.0?filter=@score_cpp_policies//sanitizers/flags:tsan + +# Activate the UBSan cc_feature (score_ubsan) for the //sanitizers/flags:ubsan_on config_setting. +build:ubsan --@score_cpp_policies//sanitizers/flags:ubsan +# Docs: https://registry.build/flag/bazel@8.3.0?filter=@score_cpp_policies//sanitizers/flags:ubsan + +# Run the consumer's clang-tidy aspect (see clang_tidy/README.md step 3-4) under --config=clang-tidy. +test:clang-tidy --aspects="//tools/lint:linters.bzl%clang_tidy_aspect" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=aspects + +# Keep debug symbols (-g1, --strip=never) so sanitizer stack traces are readable. +build:asan --config="with_debug_symbols" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=config + +# Keep debug symbols (-g1, --strip=never) so sanitizer stack traces are readable. +build:ubsan --config="with_debug_symbols" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=config + +# Keep debug symbols (-g1, --strip=never) so sanitizer stack traces are readable. +build:lsan --config="with_debug_symbols" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=config + +# Keep debug symbols (-g1, --strip=never) so sanitizer stack traces are readable. +build:tsan --config="with_debug_symbols" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=config + +# Composite config: address + leak + UB checking together. +build:asan_ubsan_lsan --config="asan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=config + +# Composite config: address + leak + UB checking together. +build:asan_ubsan_lsan --config="ubsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=config + +# Composite config: address + leak + UB checking together. +build:asan_ubsan_lsan --config="lsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=config + +# Composite config: thread + UB checking together. +build:tsan_ubsan --config="tsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=config + +# Composite config: thread + UB checking together. +build:tsan_ubsan --config="ubsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=config + +# Use the LLVM toolchain registered by the consumer's llvm_toolchain extension for clang-tidy. +test:clang-tidy --extra_toolchains="@llvm_toolchain//:cc-toolchain-x86_64-linux" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=extra_toolchains + +# Emit -g1 debug info under any sanitizer config so stack traces resolve symbols. +test:with_debug_symbols --features="debug_symbols" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=features + +# Compile/link with -fsanitize=address via the score_asan cc_feature. +build:asan --features="score_asan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=features + +# Compile/link with -fsanitize=undefined via the score_ubsan cc_feature. +build:ubsan --features="score_ubsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=features + +# Compile/link with -fsanitize=leak via the score_lsan cc_feature. +build:lsan --features="score_lsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=features + +# Compile/link with -fsanitize=thread via the score_tsan cc_feature. +build:tsan --features="score_tsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=features + +# Surface the rules_lint_report output group produced by the clang-tidy aspect. +test:clang-tidy --output_groups="+rules_lint_report" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=output_groups + +# Disambiguate the asan output tree from plain builds. +build:asan --platform_suffix="asan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=platform_suffix + +# Disambiguate the ubsan output tree from plain builds. +build:ubsan --platform_suffix="ubsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=platform_suffix + +# Disambiguate the lsan output tree from plain builds. +build:lsan --platform_suffix="lsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=platform_suffix + +# Disambiguate the tsan output tree from plain builds. +build:tsan --platform_suffix="tsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=platform_suffix + +# Canonical suffix for the composite asan+ubsan+lsan config, overriding the per-sanitizer suffixes. +build:asan_ubsan_lsan --platform_suffix="asan_ubsan_lsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=platform_suffix + +# Canonical suffix for the composite tsan+ubsan config, overriding the per-sanitizer suffixes. +build:tsan_ubsan --platform_suffix="tsan_ubsan" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=platform_suffix + +# Run tests under the sanitizers wrapper so suppressions/options env files are applied. +test:asan --run_under="@score_cpp_policies//sanitizers:wrapper" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=run_under + +# Run tests under the sanitizers wrapper so suppressions/options env files are applied. +test:ubsan --run_under="@score_cpp_policies//sanitizers:wrapper" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=run_under + +# Run tests under the sanitizers wrapper so suppressions/options env files are applied. +test:lsan --run_under="@score_cpp_policies//sanitizers:wrapper" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=run_under + +# Run tests under the sanitizers wrapper so suppressions/options env files are applied. +test:tsan --run_under="@score_cpp_policies//sanitizers:wrapper" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=run_under + +# Never strip symbols under any sanitizer config so stack traces remain readable. +build:with_debug_symbols --strip="never" +# Docs: https://registry.build/flag/bazel@8.3.0?filter=strip