-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.bazelrc
More file actions
57 lines (52 loc) · 2.32 KB
/
.bazelrc
File metadata and controls
57 lines (52 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# For all builds, use C++17
build --cxxopt="-std=c++17"
# For Apple Silicon
build:apple_silicon --cpu=darwin_arm64
build:apple_silicon --features=oso_prefix_is_pwd
# -----------------------------------------------------------------------------
# Sanitizer / dynamic-analysis configurations.
#
# Pick one with `--config=<name>`, e.g.
# bazel test --config=asan //toolbelt:sockets_test
# bazel test --config=tsan //toolbelt:sockets_test
# bazel test --config=valgrind //toolbelt:sockets_test
#
# All three configs preserve debug information so failures point back to
# meaningful source locations.
# -----------------------------------------------------------------------------
# AddressSanitizer. Detects use-after-free, heap/stack/global buffer
# overflows, use-after-return, etc.
build:asan --strip=never
build:asan --copt=-fsanitize=address
build:asan --copt=-DADDRESS_SANITIZER
build:asan --copt=-g
build:asan --copt=-O1
build:asan --copt=-fno-omit-frame-pointer
build:asan --linkopt=-fsanitize=address
# Note: leak detection (LSan) is only supported on Linux; opting out keeps the
# config portable to macOS. On Linux you can enable it with
# --test_env=ASAN_OPTIONS=halt_on_error=1:detect_leaks=1
test:asan --test_env=ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:detect_leaks=0:print_summary=1
# ThreadSanitizer. Detects data races and several kinds of synchronization
# bugs.
build:tsan --strip=never
build:tsan --copt=-fsanitize=thread
build:tsan --copt=-DTHREAD_SANITIZER
build:tsan --copt=-g
build:tsan --copt=-O1
build:tsan --copt=-fno-omit-frame-pointer
build:tsan --linkopt=-fsanitize=thread
test:tsan --test_env=TSAN_OPTIONS=halt_on_error=1:second_deadlock_stack=1:history_size=7
# Valgrind. Runs the unmodified binary under Memcheck.
#
# Notes:
# * Valgrind is not available on macOS arm64. Use Linux (or x86_64) to
# exercise this config.
# * --error-exitcode=1 makes the test fail on any reported error.
# * --child-silent-after-fork=yes suppresses noise from forking helpers.
build:valgrind --strip=never
build:valgrind --copt=-g
build:valgrind --copt=-O1
build:valgrind --copt=-fno-omit-frame-pointer
test:valgrind --run_under='valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=definite,possible --track-origins=yes --child-silent-after-fork=yes --trace-children=yes'
test:valgrind --test_timeout=300