Remove ASan from the default build mode (#7003)

Also increases the default optimization to `-Og` which is likely to give
faster turn-around time which is what we want to optimize for here. This
should also _substantially_ shrink binary sizes, etc.

ASan is still available via `--config=asan`, and is added to the CI
infrastructure. However, my current thought is to only run it after push
rather than in PRs and in the merge queue.
This commit is contained in:
Chandler Carruth
2026-04-01 16:45:53 +00:00
committed by GitHub
parent dfac728571
commit 2bbcfa5e1a
4 changed files with 20 additions and 6 deletions
+15
View File
@@ -24,6 +24,7 @@ contributions.
- [Optional tools](#optional-tools)
- [Jujutsu (`jj`)](#jujutsu-jj)
- [AI assistants](#ai-assistants)
- [Running tests with AddressSanitizer (ASan)](#running-tests-with-addresssanitizer-asan)
- [Manually building Clang and LLVM (not recommended)](#manually-building-clang-and-llvm-not-recommended)
- [Troubleshooting build issues](#troubleshooting-build-issues)
- [`bazel clean`](#bazel-clean)
@@ -310,6 +311,20 @@ git show
git status
```
### Running tests with AddressSanitizer (ASan)
By default, the Bazel build mode for the toolchain does not enable
AddressSanitizer (ASan). If you wish to enable ASan for local testing, you must
pass the `--config=asan` flag explicitly:
```shell
bazelisk test --config=asan //...
```
Note that our Continuous Integration (CI) infrastructure runs a separate
configuration for ASan to ensure test coverage without slowing down the default
test cycle.
### Manually building Clang and LLVM (not recommended)
We primarily test against [apt.llvm.org](https://apt.llvm.org) and Homebrew