| 1 |
# bazelrc file |
| 2 |
|
| 3 |
build --client_env=CC=clang |
| 4 |
build --copt=-DGRPC_BAZEL_BUILD |
| 5 |
build --cxxopt='-std=c++14' |
| 6 |
build --action_env=GRPC_BAZEL_RUNTIME=1 |
| 7 |
build --define=use_fast_cpp_protos=true |
| 8 |
|
| 9 |
build:opt --compilation_mode=opt |
| 10 |
build:opt --copt=-Wframe-larger-than=16384 |
| 11 |
|
| 12 |
build:dbg --compilation_mode=dbg |
| 13 |
build:dbg --copt=-Werror=return-stack-address |
| 14 |
|
| 15 |
# Dynamic link cause issues like: `dyld: malformed mach-o: load commands size (59272) > 32768` |
| 16 |
# https://github.com/bazelbuild/bazel/issues/9190 |
| 17 |
build:macos --dynamic_mode=off |
| 18 |
|
| 19 |
build:windows_opt --compilation_mode=opt |
| 20 |
build:windows_dbg --compilation_mode=dbg |
| 21 |
|
| 22 |
build:asan --strip=never |
| 23 |
build:asan --copt=-fsanitize=address |
| 24 |
build:asan --copt=-O0 |
| 25 |
build:asan --copt=-fno-omit-frame-pointer |
| 26 |
build:asan --copt=-DGPR_NO_DIRECT_SYSCALLS |
| 27 |
build:asan --copt=-DGRPC_ASAN |
| 28 |
build:asan --copt=-DADDRESS_SANITIZER # used by absl |
| 29 |
build:asan --linkopt=-fsanitize=address |
| 30 |
build:asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always |
| 31 |
build:asan --action_env=LSAN_OPTIONS=suppressions=test/core/util/lsan_suppressions.txt:report_objects=1 |
| 32 |
|
| 33 |
build:fuzzer_asan --strip=never |
| 34 |
build:fuzzer_asan --define=grpc_build_fuzzers=true |
| 35 |
build:fuzzer_asan --copt=-fsanitize=fuzzer,address |
| 36 |
build:fuzzer_asan --copt=-fsanitize-coverage=edge |
| 37 |
build:fuzzer_asan --copt=-fsanitize-coverage=trace-cmp |
| 38 |
build:fuzzer_asan --copt=-O0 |
| 39 |
build:fuzzer_asan --copt=-fno-omit-frame-pointer |
| 40 |
build:fuzzer_asan --copt=-DGPR_NO_DIRECT_SYSCALLS |
| 41 |
build:fuzzer_asan --copt=-DGRPC_ASAN |
| 42 |
build:fuzzer_asan --copt=-DADDRESS_SANITIZER # used by absl |
| 43 |
build:fuzzer_asan --linkopt=-fsanitize=fuzzer,address |
| 44 |
build:fuzzer_asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always |
| 45 |
build:fuzzer_asan --action_env=LSAN_OPTIONS=suppressions=test/core/util/lsan_suppressions.txt:report_objects=1 |
| 46 |
|
| 47 |
# We have a separate ASAN config for Mac OS to workaround a couple of bugs: |
| 48 |
# 1. https://github.com/bazelbuild/bazel/issues/6932 |
| 49 |
# _FORTIFY_SOURCE=1 is enabled by default on Mac OS, which breaks ASAN. |
| 50 |
# We workaround it by setting _FORTIFY_SOURCE=0 and ignoring macro redefined |
| 51 |
# warnings. |
| 52 |
# 2. https://github.com/google/sanitizers/issues/1026 |
| 53 |
# LSAN is not supported by the version of Clang that ships with Mac OS, so |
| 54 |
# we disable it. |
| 55 |
build:asan_macos --strip=never |
| 56 |
build:asan_macos --copt=-fsanitize=address |
| 57 |
build:asan_macos --copt -Wno-macro-redefined |
| 58 |
build:asan_macos --copt -D_FORTIFY_SOURCE=0 |
| 59 |
build:asan_macos --copt=-fsanitize=address |
| 60 |
build:asan_macos --copt=-O0 |
| 61 |
build:asan_macos --copt=-fno-omit-frame-pointer |
| 62 |
build:asan_macos --copt=-DGPR_NO_DIRECT_SYSCALLS |
| 63 |
build:asan_macos --linkopt=-fsanitize=address |
| 64 |
build:asan_macos --action_env=ASAN_OPTIONS=detect_leaks=0 |
| 65 |
build:asan_macos --dynamic_mode=off |
| 66 |
|
| 67 |
build:msan --strip=never |
| 68 |
build:msan --copt=-fsanitize=memory |
| 69 |
build:msan --copt=-O0 |
| 70 |
build:msan --copt=-fsanitize-memory-track-origins |
| 71 |
build:msan --copt=-fsanitize-memory-use-after-dtor |
| 72 |
build:msan --copt=-fno-omit-frame-pointer |
| 73 |
build:msan --copt=-DGPR_NO_DIRECT_SYSCALLS |
| 74 |
build:msan --linkopt=-fsanitize=memory |
| 75 |
build:msan --action_env=MSAN_OPTIONS=poison_in_dtor=1 |
| 76 |
|
| 77 |
build:tsan --strip=never |
| 78 |
build:tsan --copt=-fsanitize=thread |
| 79 |
build:tsan --copt=-fno-omit-frame-pointer |
| 80 |
build:tsan --copt=-DGPR_NO_DIRECT_SYSCALLS |
| 81 |
build:tsan --copt=-DGRPC_TSAN |
| 82 |
build:tsan --linkopt=-fsanitize=thread |
| 83 |
# This is needed to address false positive problem with abseil. |
| 84 |
# https://github.com/google/sanitizers/issues/953 |
| 85 |
build:tsan --test_env=TSAN_OPTIONS=report_atomic_races=0 |
| 86 |
build:tsan --action_env=TSAN_OPTIONS=suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1 |
| 87 |
|
| 88 |
build:tsan_macos --strip=never |
| 89 |
build:tsan_macos --copt=-fsanitize=thread |
| 90 |
build:tsan_macos --copt=-fno-omit-frame-pointer |
| 91 |
build:tsan_macos --copt=-DGPR_NO_DIRECT_SYSCALLS |
| 92 |
build:tsan_macos --copt=-DGRPC_TSAN |
| 93 |
build:tsan_macos --linkopt=-fsanitize=thread |
| 94 |
build:tsan_macos --test_env=TSAN_OPTIONS=report_atomic_races=0 |
| 95 |
build:tsan_macos --action_env=TSAN_OPTIONS=suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1 |
| 96 |
build:tsan_macos --dynamic_mode=off |
| 97 |
|
| 98 |
build:ubsan --strip=never |
| 99 |
build:ubsan --copt=-fsanitize=undefined |
| 100 |
build:ubsan --copt=-fsanitize-link-c++-runtime |
| 101 |
build:ubsan --copt=-fno-omit-frame-pointer |
| 102 |
build:ubsan --copt=-DGRPC_UBSAN |
| 103 |
build:ubsan --copt=-DNDEBUG |
| 104 |
build:ubsan --copt=-fno-sanitize=function,vptr |
| 105 |
build:ubsan --linkopt=-fsanitize=undefined |
| 106 |
# avoid ubsan build error with int128 by linking against libc++ |
| 107 |
# see b/200667821 |
| 108 |
build:ubsan --linkopt=-fsanitize-link-c++-runtime |
| 109 |
build:ubsan --linkopt=-lc++ |
| 110 |
build:ubsan --linkopt=-lc++abi |
| 111 |
build:ubsan --linkopt=-lm |
| 112 |
build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt |
| 113 |
# if you want to run ubsan locally, uncomment following three lines |
| 114 |
# build:ubsan --linkopt=-lgcc_s |
| 115 |
# build:ubsan --linkopt=-lubsan |
| 116 |
# build:ubsan --linkopt=--rtlib=compiler-rt |
| 117 |
|
| 118 |
build:python_single_threaded_unary_stream --test_env="GRPC_SINGLE_THREADED_UNARY_STREAM=true" |
| 119 |
|
| 120 |
build:python_poller_engine --test_env="GRPC_ASYNCIO_ENGINE=poller" |
| 121 |
|
| 122 |
# Compile database generation config |
| 123 |
build:compdb --build_tag_filters=-nocompdb --features=-layering_check |