-
Notifications
You must be signed in to change notification settings - Fork 15
/
.bazelrc
109 lines (94 loc) · 4.38 KB
/
.bazelrc
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# general build options
build --compilation_mode=dbg
build --host_compilation_mode=fastbuild
build --verbose_failures
build --experimental_strict_action_env
build --experimental_guard_against_concurrent_changes
# This causes bazel to pass --config=windows/macos/linux automatically for us.
build --enable_platform_specific_config
# We enable the nocopts flag because it's used in the OpenSSL rules
build --noincompatible_disable_nocopts
# Enable symlinking of runfiles on all platforms (including Windows, where it's disable by default).
build --enable_runfiles --build_runfile_links
# Avoids downloading any remote build outputs to the local machine, except the ones required by local actions.
# Commenting out for now as it may be causing builds to flake.
#build --remote_download_minimal
# general test options - note that test inherits from build, so these are in addition to the ones
# above
test --test_output=errors
build:release --compilation_mode=opt
build:release --host_compilation_mode=opt
build:ci --keep_going
build:ci --announce_rc
#build:linux --copt="-O1"
#build:linux --copt="-march=skylake"
build:linux --copt="-fvisibility=hidden"
build:linux --copt="-fno-omit-frame-pointer" # for friendlier stack traces
build:linux --copt="-Wno-error"
build:linux --copt="-Wall"
build:linux --copt="-Wextra"
build:linux --copt="-Werror=return-type"
build:linux --copt="-Werror=switch"
build:linux --copt="-mavx"
build:linux --copt="-Wsequence-point"
build:linux --copt="-Wsign-compare"
build:linux --cxxopt="-std=c++17"
build:linux-release --config=release
build:linux-release --config=linux
build:linux-release --copt="-O3"
build:benchmark --config=linux-release
build:benchmark --copt="-g" # To get code references in vtune
build:macos --copt="-fvisibility=hidden"
build:macos --copt="-Wno-error"
build:macos --cxxopt="-std=c++17"
build:windows --cxxopt="/std:c++17"
# Disables wingdi.h, which avoids defining a macro called ERROR.
build:windows --cxxopt="/DNOGDI"
build:windows --features=static_link_msvcrt
# We fix the temp directory, as otherwise it is different across different Windows BK agents, which causes
# the remote cache to never be hit due to differing build graph hashes.
build:windows --action_env TMP=C:/Windows/Temp
build:windows --action_env TEMP=C:/Windows/Temp
build:windows --cxxopt="/DWIN32_LEAN_AND_MEAN"
# Valgrind config.
build:valgrind-memcheck --config=linux
build:valgrind-memcheck --define valgrind-memcheck=true
test:valgrind-memcheck --run_under=//tools/runners/sanitizers/valgrind-memcheck
run:valgrind-memcheck --run_under=//tools/runners/sanitizers/valgrind-memcheck
# Sanitizer configs; for an overview of the sanitizers, see https://github.com/google/sanitizers/wiki
# For more specific information on sanitizers:
# - https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
# - https://clang.llvm.org/docs/AddressSanitizer.html
# - https://clang.llvm.org/docs/ThreadSanitizer.html
build:base-sanitizer --copt="-fno-omit-frame-pointer" # for friendlier stack traces
build:base-sanitiser -strip=never
build:asan --config=base-sanitizer
build:asan --copt="-O1"
build:asan --copt="-fno-optimize-sibling-calls"
build:asan --copt="-fsanitize=address"
build:asan --linkopt="-fsanitize=address"
test:asan --test_env="ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-9/bin/llvm-symbolizer"
test:asan --run_under=//tools/runners/sanitizers/asan
build:tsan --config=base-sanitizer
build:tsan --copt="-O1"
build:tsan --copt="-fno-optimize-sibling-calls"
build:tsan --copt="-fsanitize=thread"
build:tsan --linkopt="-fsanitize=thread"
#test:tsan --test_env="TSAN_SYMBOLIZER_PATH=/usr/lib/llvm-9/bin/llvm-symbolizer"
test:tsan --run_under=//tools/runners/sanitizers/tsan
build:ubsan --config=base-sanitizer
build:ubsan --copt="-O1"
build:ubsan --copt="-fsanitize=undefined"
build:ubsan --copt="-fno-sanitize-recover=all"
# Since Bazel uses clang instead of clang++, enabling -fsanitize=vptr would
# require extra linkopts that cause segmentation faults on pure C code.
build:ubsan --copt="-fno-sanitize=function"
build:ubsan --linkopt="-fsanitize=undefined"
build:ubsan --linkopt="-lubsan"
test:ubsan --run_under=//tools/runners/sanitizers/ubsan
# MSAN is disabled for now, as there are false positives and we can't suppress them easily.
#build:msan --config=base-sanitizer
#build:msan --copt="-fsanitize=memory"
#build:msan --linkopt="-fsanitize=memory"
#test:msan --run_under=//tools/runners/sanitizers/msan
build:lint --define linting_only=true