This repository has been archived by the owner on Sep 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bazelrc
84 lines (71 loc) · 2.94 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
# REMINDER: WHEN CHANGING THIS FILE, PLEASE CHANGE ALL .BAZELRC FILES IN ALL THREE REPOS!!!!
# (unfortunately, we cannot have a single source of truth...)
build --incompatible_enable_cc_toolchain_resolution
# this is for rules_rust
build --repo_env=RULES_RUST_TOOLCHAIN_INCLUDE_RUSTC_SRCS=true
# 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
# 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
# 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
# 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 -O3
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 -O3
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 -O3
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 -O3
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