-
Notifications
You must be signed in to change notification settings - Fork 3
/
.bazelrc
108 lines (88 loc) · 3.67 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
build --workspace_status_command=$(pwd)/status.sh
# Required for bazel_clang_tidy to operate as expected
build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
build:clang-tidy --output_groups=report
# Optionally override the .clang-tidy config file target
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config
# note: each bazelrc that try-imports this one needs to try-import the buildbuddy bazelrc but using the correct relative path
try-import %workspace%/.buildbuddy.bazelrc
# REMINDER: WHEN CHANGING THIS FILE, PLEASE CHANGE ALL .BAZELRC FILES IN ALL THREE REPOS!!!!
# (unfortunately, we cannot have a single source of truth...)
# below copied from asphr
# to prevent problems with CI, we cannot try-import this bazelrc from other places. instead we just copy-paste.
build --incompatible_enable_cc_toolchain_resolution
# this is for rules_rust
build --repo_env=RULES_RUST_TOOLCHAIN_INCLUDE_RUSTC_SRCS=true
# To debug the toolchain build, uncomment the following line:
# build --toolchain_resolution_debug=@bazel_tools//tools/cpp:toolchain_type
# note: each bazelrc that try-imports this one needs to include a .user.bazelrc in its workspace directory
try-import %workspace%/.user.bazelrc
# setting up remote caching
build --bes_results_url=https://app.buildbuddy.io/invocation/
build --bes_backend=grpcs://remote.buildbuddy.io
build --remote_cache=grpcs://remote.buildbuddy.io
build --remote_upload_local_results
build --remote_timeout=3600
# build --experimental_remote_cache_compression
# build --experimental_remote_cache_async
# build --remote_download_toplevel
build --genrule_strategy=local
# test --test_strategy=standalone
# By default build in C++20 mode
build --cxxopt=-std=c++20
# c++ warning flags
build --cxxopt=-Wall
build --cxxopt=-Wextra
# build --cxxopt=-Wcast-qual
build --cxxopt=-Wno-unused-parameter
build --cxxopt=-Wpointer-arith
# build using -lprofiler flag for profiling
# build --cxxopt=-lprofiler
# build --linkopt=-lprofiler
build:perf --copt=-g
build:perf --cxxopt=-g
build:perf --cxxopt=-O2
build:perf --linkopt=-g
build:perf --copt -fno-omit-frame-pointer
build:perf --strip=never
# Address sanitizer
# CC=clang bazel build --config asan
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
# we ignore ODR violations because we have two versions of zlib, one from protobuf and one from seal. not good. but issok.
build:asan --action_env=ASAN_OPTIONS=detect_odr_violation=0
build:asan --linkopt -fsanitize=address
# Memory sanitizer
# CC=clang bazel build --config msan
build:msan --strip=never
build:msan --copt -fsanitize=memory
build:msan --copt -DMEMORY_SANITIZER
build:msan --copt -g
build:msan --copt -O1
build:msan --copt -fno-omit-frame-pointer
build:msan --linkopt -fsanitize=memory
# Undefined Behavior Sanitizer
# CC=clang bazel build --config ubsan
build:ubsan --strip=never
build:ubsan --copt -fsanitize=undefined
build:ubsan --copt -DUNDEFINED_BEHAVIOR_SANITIZER
build:ubsan --copt -g
build:ubsan --copt -O1
build:ubsan --copt -fno-omit-frame-pointer
build:ubsan --linkopt -fsanitize=undefined
# build:ubsan --linkopt -lubsan
# All sanitizers!
# CC=clang bazel build --config san
build:san --strip=never
build:san --copt -fsanitize=address,undefined
build:san --copt -DADDRESS_SANITIZER
build:san --copt -g
build:san --copt -O1
build:san --copt -fno-omit-frame-pointer
# we ignore ODR violations because we have two versions of zlib, one from protobuf and one from seal. not good. but issok.
build:san --action_env=ASAN_OPTIONS=detect_odr_violation=0
build:san --linkopt -fsanitize=address,undefined