Imported Upstream version 1.26.0
[platform/upstream/grpc.git] / tools / bazel.rc
1 # bazelrc file
2 # bazel >= 0.18 looks for %workspace%/.bazelrc (which redirects here)
3 # Older bazel versions look for %workspace%/tools/bazel.rc (this file)
4 # See https://github.com/bazelbuild/bazel/issues/6319
5
6 build --client_env=CC=clang
7 build --copt=-DGRPC_BAZEL_BUILD
8 build --action_env=GRPC_BAZEL_RUNTIME=1
9
10 build:opt --compilation_mode=opt
11 build:opt --copt=-Wframe-larger-than=16384
12
13 build:dbg --compilation_mode=dbg
14
15 build:windows_opt --compilation_mode=opt
16 build:windows_dbg --compilation_mode=dbg
17
18 build:asan --strip=never
19 build:asan --copt=-fsanitize=address
20 build:asan --copt=-O0
21 build:asan --copt=-fno-omit-frame-pointer
22 build:asan --copt=-DGPR_NO_DIRECT_SYSCALLS
23 build:asan --copt=-DGRPC_ASAN
24 build:asan --copt=-DADDRESS_SANITIZER  # used by absl
25 build:asan --linkopt=-fsanitize=address
26 build:asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always
27 build:asan --action_env=LSAN_OPTIONS=suppressions=test/core/util/lsan_suppressions.txt:report_objects=1
28
29 # We have a separate ASAN config for Mac OS to workaround a couple of bugs:
30 # 1. https://github.com/bazelbuild/bazel/issues/6932
31 #    _FORTIFY_SOURCE=1 is enabled by default on Mac OS, which breaks ASAN.
32 #    We workaround it by setting _FORTIFY_SOURCE=0 and ignoring macro redefined
33 #    warnings.
34 # 2. https://github.com/google/sanitizers/issues/1026
35 #    LSAN is not supported by the version of Clang that ships with Mac OS, so
36 #    we disable it.
37 build:asan_macos --strip=never
38 build:asan_macos --copt=-fsanitize=address
39 build:asan_macos --copt -Wno-macro-redefined
40 build:asan_macos --copt -D_FORTIFY_SOURCE=0
41 build:asan_macos --copt=-fsanitize=address
42 build:asan_macos --copt=-O0
43 build:asan_macos --copt=-fno-omit-frame-pointer
44 build:asan_macos --copt=-DGPR_NO_DIRECT_SYSCALLS
45 build:asan_macos --copt=-DADDRESS_SANITIZER  # used by absl
46 build:asan_macos --linkopt=-fsanitize=address
47 build:asan_macos --action_env=ASAN_OPTIONS=detect_leaks=0
48
49
50 build:msan --strip=never
51 build:msan --copt=-fsanitize=memory
52 build:msan --copt=-O0
53 build:msan --copt=-fsanitize-memory-track-origins
54 build:msan --copt=-fsanitize-memory-use-after-dtor
55 build:msan --copt=-fno-omit-frame-pointer
56 build:msan --copt=-DGPR_NO_DIRECT_SYSCALLS
57 build:msan --copt=-DMEMORY_SANITIZER  # used by absl
58 build:msan --linkopt=-fsanitize=memory
59 build:msan --action_env=MSAN_OPTIONS=poison_in_dtor=1
60
61 build:tsan --strip=never
62 build:tsan --copt=-fsanitize=thread
63 build:tsan --copt=-fno-omit-frame-pointer
64 build:tsan --copt=-DGPR_NO_DIRECT_SYSCALLS
65 build:tsan --copt=-DGRPC_TSAN
66 # TODO(jtattermusch): ideally we would set --copt=-DTHREAD_SANITIZER (used by absl)
67 # but it seems to do more harm than good and triggers #17175
68 build:tsan --linkopt=-fsanitize=thread
69 build:tsan --action_env=TSAN_OPTIONS=suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
70
71 build:ubsan --strip=never
72 build:ubsan --copt=-fsanitize=undefined
73 build:ubsan --copt=-fno-omit-frame-pointer
74 build:ubsan --copt=-DGRPC_UBSAN
75 build:ubsan --copt=-DNDEBUG
76 build:ubsan --copt=-DUNDEFINED_BEHAVIOR_SANITIZER  # used by absl
77 build:ubsan --copt=-fno-sanitize=function,vptr
78 build:ubsan --linkopt=-fsanitize=undefined
79 build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt
80 # For some reasons, these two stopped being propagated, so, redeclaring them here.
81 # That's a hack that needs to be removed once we understand what's going on.
82 build:ubsan --copt=-DGRPC_PORT_ISOLATED_RUNTIME=1
83
84 build:basicprof --strip=never
85 build:basicprof --copt=-DNDEBUG
86 build:basicprof --copt=-O2
87 build:basicprof --copt=-DGRPC_BASIC_PROFILER
88 build:basicprof --copt=-DGRPC_TIMERS_RDTSC
89
90 build:python_single_threaded_unary_stream --test_env="GRPC_SINGLE_THREADED_UNARY_STREAM=true"