-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy path.bazelrc
More file actions
87 lines (78 loc) · 4 KB
/
Copy path.bazelrc
File metadata and controls
87 lines (78 loc) · 4 KB
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
# --apple_generate_dsym is intentionally NOT global: it forces -g onto every
# compile and ~doubles build output, wasted on dev/test builds. Builds that ship
# dSYMs pass it explicitly (Makefile release targets; santa-codesign's release.yml).
# For local debugging use `-c dbg` (emits -g without the dSYM bundle).
#
# Keep apple.propagate_embedded_extra_outputs global: it is inert unless dSYMs are
# being generated, but for release builds it is what puts the EMBEDDED binaries'
# dSYMs (daemon, services, CLIs) into //Source/gui:Santa's default outputs for the
# //:release genrule to collect. Without it, releases silently ship with only
# Santa.app's dSYM -- the daemon and services lose their symbols.
build --define=apple.propagate_embedded_extra_outputs=yes
build --copt=-Werror
build --copt=-Wall
build --copt=-Wformat-security
build --copt=-Wnullability-completeness
build --copt=-Wno-error=deprecated-declarations
build --copt=-Wreorder-init-list
build --copt=-Wsemicolon-before-method-body
build --copt=-Wc99-designator
build --copt=-Wno-c++20-designator
# Disable -Wunknown-warning-option because deprecated-non-prototype
# isn't recognized on older SDKs
build --copt=-Wno-unknown-warning-option
build --copt=-Wno-error=deprecated-non-prototype
build --per_file_copt=.*\.mm\$@-std=c++23
build --cxxopt=-std=c++23
build --host_cxxopt=-std=c++23
# Use ThinLTO for faster link times than full LTO with 90%+ of the LTO benefits
build:opt --copt=-flto=thin
build:opt --linkopt=-flto=thin
# Enable C++ interoperability in Swift
build --@rules_swift//swift:copt=-cxx-interoperability-mode=default
build --@rules_swift//swift:copt=-Xcc
build --@rules_swift//swift:copt=-std=c++23
# cel-cpp has lots of warnings that we don't need to see (and definitely don't
# want to be treated as errors).
build --per_file_copt=.*cel-cpp.*@-Wno-deprecated-declarations
build --per_file_copt=.*cel-cpp.*@-Wno-nontrivial-memcall
build --per_file_copt=.*cel-cpp.*@-Wno-nullability-completeness
build --per_file_copt=.*cel-cpp.*@-Wno-unused-function
build --per_file_copt=.*cel-cpp.*@-Wno-unused-result
# protobuf v33.0 introduced a large number of warnings when building
# the dependency about the use of newly deprecated functions.
build --per_file_copt=external/protos\+.*@-Wno-deprecated-declarations
build --host_per_file_copt=external/protobuf.*@-Wno-deprecated-declarations
# protobuf v34 has an unused private field in descriptor.cc.
build --per_file_copt=external/protobuf.*@-Wno-unused-private-field
build --host_per_file_copt=external/protobuf.*@-Wno-unused-private-field
# Many config options for sanitizers pulled from
# https://github.com/protocolbuffers/protobuf/blob/main/.bazelrc
build:san-common --strip=never
build:san-common --copt="-Wno-macro-redefined"
build:san-common --copt="-D_FORTIFY_SOURCE=0"
build:san-common --copt="-O1"
build:san-common --copt="-fno-omit-frame-pointer"
build:asan --config=san-common
build:asan --copt="-fsanitize=address"
build:asan --copt="-DADDRESS_SANITIZER"
build:asan --linkopt="-fsanitize=address"
build:asan --test_env="ASAN_OPTIONS=log_path=/tmp/san_out"
build:tsan --config=san-common
build:tsan --copt="-fsanitize=thread"
build:tsan --copt="-DTHREAD_SANITIZER=1"
build:tsan --linkopt="-fsanitize=thread"
build:tsan --test_env="TSAN_OPTIONS=log_path=/tmp/san_out:halt_on_error=true"
build:ubsan --config=san-common
build:ubsan --copt="-fsanitize=undefined"
build:ubsan --copt="-DUNDEFINED_SANITIZER=1"
build:ubsan --copt="-fno-sanitize=function" --copt="-fno-sanitize=vptr"
build:ubsan --linkopt="-fsanitize=undefined"
build:ubsan --test_env="UBSAN_OPTIONS=log_path=/tmp/san_out"
# libFuzzer + ASan for fuzz targets under //Testing/Fuzzing/...
# Mirrors the prototype's --config=fuzz configuration; layered on top of
# the shared san-common block (also used by --config=asan/tsan/ubsan).
build:fuzz --config=san-common
build:fuzz --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
build:fuzz --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
build:fuzz --@rules_fuzzing//fuzzing:cc_engine_sanitizer=asan