forked from envoyproxy/envoy-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bazelrc
250 lines (232 loc) · 13.7 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# Envoy Mobile Bazel build/test options.
try-import ./envoy/.bazelrc
# Common flags for all builds
build --platform_mappings=envoy/bazel/platform_mappings
build --define=google_grpc=disabled
build --define=hot_restart=disabled
build --define=tcmalloc=disabled
build --experimental_inmemory_dotd_files
build --experimental_inmemory_jdeps_files
build --features=debug_prefix_map_pwd_is_dot
build --features=swift.cacheable_swiftmodules
build --features=swift.debug_prefix_map
build --host_force_python=PY3
build --macos_minimum_os=10.14
build --ios_minimum_os=12.0
build --ios_simulator_device="iPhone 13"
build --ios_simulator_version=15.5
build --verbose_failures
build --workspace_status_command=envoy/bazel/get_workspace_status
build --xcode_version=13.4.0
build --use_top_level_targets_for_symlinks
build --experimental_repository_downloader_retries=2
# https://github.com/bazelbuild/rules_jvm_external/issues/445
build --repo_env=JAVA_HOME=../bazel_tools/jdk
build --define disable_known_issue_asserts=true
build --define cxxopts=-std=c++17
# Unset per_object_debug_info. Causes failures on Android Linux release builds.
build --features=-per_object_debug_info
# Suppress deprecated declaration warnings due to extensive transitive noise from protobuf.
build --copt -Wno-deprecated-declarations
# Abseil Flag literals are compiled out by default on mobile platforms. These flags are needed for
# Envoy's runtime system. This option prevents them from being compiled out.
build --copt -DABSL_FLAGS_STRIP_NAMES=0
# The defaults are JDK 11 on newer versions of Bazel
build --java_runtime_version=remotejdk_11
build --java_language_version=8
# Override PGV validation with NOP functions
build --@com_envoyproxy_protoc_gen_validate//bazel:template-flavor=nop
build:dbg-common --compilation_mode=dbg
# Enable source map for debugging in IDEs
build:dbg-common --copt="-fdebug-compilation-dir" --copt="/proc/self/cwd"
# Default flags for builds targeting iOS
# Manual stamping is necessary in order to get versioning information in the iOS
# static framework.
# More information on stamping can be found here:
# https://github.com/envoyproxy/envoy/tree/master/bazel#enabling-optional-features
build:ios --define=manual_stamp=manual_stamp
# Default flags for builds targeting Android
build:android --define=logger=android --define=include_ifaddrs=true
# Default flags for Android debug builds
build:dbg-android --config=dbg-common
build:dbg-android --config=android
# Default flags for iOS debug builds
build:dbg-ios --config=dbg-common
build:dbg-ios --config=ios
# Locally-runnable ASAN config for MacOS & Linux with standard dev environment
# See also:
# https://github.com/bazelbuild/bazel/issues/6932
build:asan-dev --strip=never
build:asan-dev --copt -Wno-macro-redefined # ASAN sets _FORTIFY_SOURCE=0
build:asan-dev --copt -DADDRESS_SANITIZER
build:asan-dev --copt -D_LIBCPP_HAS_NO_ASAN
build:asan-dev --copt -g
build:asan-dev --copt -fno-omit-frame-pointer
build:asan-dev --copt -fno-optimize-sibling-calls
build:asan-dev --copt -fsanitize=address
build:asan-dev --linkopt -fsanitize=address
build:asan-dev --platform_suffix=-asan
build:clang-asan --linkopt --rtlib=compiler-rt
build:clang-asan --linkopt --unwindlib=libgcc
# Locally-runnable TSAN config
build:tsan-dev --features=tsan
build:tsan-dev --copt -fsanitize=thread
build:tsan-dev --linkopt -fsanitize=thread
build:tsan-dev --test_env=ENVOY_IP_TEST_VERSIONS=v4only
build:tsan-dev --platform_suffix=-tsan
# Needed due to https://github.com/libevent/libevent/issues/777
build:tsan-dev --copt -DEVENT__DISABLE_DEBUG_MODE
# https://github.com/abseil/abseil-cpp/issues/760
# https://github.com/google/sanitizers/issues/953
build:tsan-dev --test_env="TSAN_OPTIONS=report_atomic_races=0"
# Exclude debug info from the release binary since it makes it too large to fit
# into a zip file. This shouldn't affect crash reports.
build:release-common --define=no_debug_info=1
# Compile releases optimizing for size (eg -Os, etc).
build:release-common --config=sizeopt
# Set default symbols visibility to hidden to reduce .dynstr and the symbol table size
build:release-common --copt=-fvisibility=hidden
# Flags for release builds targeting iOS
build:release-ios --config=ios
build:release-ios --config=release-common
build:release-ios --compilation_mode=opt
# Flags for release builds targeting Android or the JVM
# Release does not use the option --define=logger=android
build:release-android --define=include_ifaddrs=true
build:release-android --config=release-common
build:release-android --compilation_mode=opt
# Instrument Envoy Mobile's C++ code for coverage
build:coverage --instrumentation_filter="//library/common[/:]"
#############################################################################
# Experimental EngFlow Remote Execution Configs
#############################################################################
# remote-ci-common: These options are valid for any platform, use the configs below
# to add platform-specific options. Avoid using this config directly and
# instead use a platform-specific config
#############################################################################
# --config=remote sets --auth_enabled=true to enable GCP authentication,
# however, the remote execution cluster doesn't use GCP auth (it uses
# GITHUB_TOKEN auth) so we have to override it to 'false' here.
build:remote-ci-common --config=remote
build:remote-ci-common --auth_enabled=false
build:remote-ci-common --remote_executor=grpcs://envoy.cluster.engflow.com
build:remote-ci-common --bes_backend=grpcs://envoy.cluster.engflow.com/
build:remote-ci-common --bes_results_url=https://envoy.cluster.engflow.com/invocation/
build:remote-ci-common --bes_lifecycle_events
build:remote-ci-common --jobs=40
build:remote-ci-common --verbose_failures
build:remote-ci-common --spawn_strategy=remote,sandboxed,local
# Avoid hanging if the remote side closes the connection without a TCP RST. Only
# sends a keepalive if we don't receive any messages (server updates every 60s).
build:remote-ci-common --grpc_keepalive_time=61s
#############################################################################
# remote-ci-linux: These options are linux-only using GCC by default
#############################################################################
# Common Engflow flags
build:remote-ci-linux --define=EXECUTOR=remote
build:remote-ci-linux --disk_cache=
build:remote-ci-linux --incompatible_strict_action_env=true
build:remote-ci-linux --remote_timeout=600
# GCC toolchain options
build:remote-ci-linux --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:remote-ci-linux --crosstool_top=//third_party/rbe_configs/cc:toolchain
build:remote-ci-linux --extra_execution_platforms=//third_party/rbe_configs/config:platform
build:remote-ci-linux --extra_toolchains=//third_party/rbe_configs/config:cc-toolchain
build:remote-ci-linux --host_platform=//third_party/rbe_configs/config:platform
build:remote-ci-linux --platforms=//third_party/rbe_configs/config:platform
build:remote-ci-linux --config=remote-ci-common
#############################################################################
# remote-ci-linux-clang: These options are linux-only using Clang by default
#############################################################################
build:remote-ci-linux-clang --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:remote-ci-linux-clang --action_env=CC=/opt/llvm/bin/clang
build:remote-ci-linux-clang --action_env=CXX=/opt/llvm/bin/clang++
build:remote-ci-linux-clang --crosstool_top=//third_party/rbe_configs/cc:toolchain
build:remote-ci-linux-clang --extra_execution_platforms=//third_party/rbe_configs/config:platform
build:remote-ci-linux-clang --extra_toolchains=//third_party/rbe_configs/config:cc-toolchain
build:remote-ci-linux-clang --host_platform=//third_party/rbe_configs/config:platform
build:remote-ci-linux-clang --platforms=//third_party/rbe_configs/config:platform
build:remote-ci-linux-clang --config=remote-ci-common
#############################################################################
# remote-ci-linux-asan: These options are Linux-only using Clang and AddressSanitizer
#############################################################################
build:remote-ci-linux-asan --config=clang-asan
build:remote-ci-linux-asan --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:remote-ci-linux-asan --action_env=CC=/opt/llvm/bin/clang
build:remote-ci-linux-asan --action_env=CXX=/opt/llvm/bin/clang++
build:remote-ci-linux-asan --crosstool_top=//third_party/rbe_configs/cc:toolchain
build:remote-ci-linux-asan --extra_execution_platforms=//third_party/rbe_configs/config:platform-asan
build:remote-ci-linux-asan --extra_toolchains=//third_party/rbe_configs/config:cc-toolchain
build:remote-ci-linux-asan --host_platform=//third_party/rbe_configs/config:platform-asan
build:remote-ci-linux-asan --platforms=//third_party/rbe_configs/config:platform-asan
build:remote-ci-linux-asan --config=remote-ci-common
#############################################################################
# remote-ci-linux-tsan: These options are Linux-only using Clang and ThreadSanitizer
#############################################################################
build:remote-ci-linux-tsan --config=clang-tsan
build:remote-ci-linux-tsan --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:remote-ci-linux-tsan --action_env=CC=/opt/llvm/bin/clang
build:remote-ci-linux-tsan --action_env=CXX=/opt/llvm/bin/clang++
build:remote-ci-linux-tsan --crosstool_top=//third_party/rbe_configs/cc:toolchain
build:remote-ci-linux-tsan --extra_execution_platforms=//third_party/rbe_configs/config:platform
build:remote-ci-linux-tsan --extra_toolchains=//third_party/rbe_configs/config:cc-toolchain
build:remote-ci-linux-tsan --host_platform=//third_party/rbe_configs/config:platform
build:remote-ci-linux-tsan --platforms=//third_party/rbe_configs/config:platform
build:remote-ci-linux-tsan --config=remote-ci-common
#############################################################################
# remote-ci-linux-coverage: These options are Linux-only using Clang and LLVM coverage
#############################################################################
# Clang environment variables (keep in sync with //third_party/rbe_configs)
build:remote-ci-linux-coverage --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:remote-ci-linux-coverage --action_env=CC=/opt/llvm/bin/clang
build:remote-ci-linux-coverage --test_env=CC=/opt/llvm/bin/clang
build:remote-ci-linux-coverage --action_env=CXX=/opt/llvm/bin/clang++
build:remote-ci-linux-coverage --test_env=CXX=/opt/llvm/bin/clang++
# Coverage environment variables (keep in sync with //third_party/rbe_configs)
build:remote-ci-linux-coverage --action_env=GCOV=/opt/llvm/bin/llvm-profdata
build:remote-ci-linux-coverage --test_env=GCOV=/opt/llvm/bin/llvm-profdata
build:remote-ci-linux-coverage --action_env=BAZEL_LLVM_COV=/opt/llvm/bin/llvm-cov
build:remote-ci-linux-coverage --test_env=BAZEL_LLVM_COV=/opt/llvm/bin/llvm-cov
build:remote-ci-linux-coverage --action_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1
build:remote-ci-linux-coverage --test_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1
# Toolchain flags (Java is required for C++ coverage due to Bazel's LCOV merger)
build:remote-ci-linux-coverage --crosstool_top=//third_party/rbe_configs/cc:toolchain
build:remote-ci-linux-coverage --extra_execution_platforms=//third_party/rbe_configs/config:platform
build:remote-ci-linux-coverage --extra_toolchains=//third_party/rbe_configs/config:cc-toolchain
build:remote-ci-linux-coverage --host_platform=//third_party/rbe_configs/config:platform
build:remote-ci-linux-coverage --platforms=//third_party/rbe_configs/config:platform
build:remote-ci-linux-coverage --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java11
build:remote-ci-linux-coverage --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11
# Flags to run tests locally which are necessary since Bazel C++ LLVM coverage isn't fully supported for remote builds
# TODO(lfpino): Reference upstream Bazel issue here on the incompatibility of remote test execution and LLVM coverage.
build:remote-ci-linux-coverage --remote_download_outputs=all
build:remote-ci-linux-coverage --strategy=TestRunner=local,remote
build:remote-ci-linux-coverage --strategy=CoverageReport=local,remote
# Bazel remote caching is incompatible with C++ LLVM coverage so we need to deactivate it for coverage builds
# TODO(lfpino): Reference upstream Bazel issue here on the incompatibility of remote caching and LLVM coverage.
build:remote-ci-linux-coverage --noremote_accept_cached
build:remote-ci-linux-coverage --config=remote-ci-common
# IPv6 tests fail on CI
build:remote-ci-linux-coverage --test_env=ENVOY_IP_TEST_VERSIONS=v4only
#############################################################################
# remote-ci-macos: These options are macOS-only
#############################################################################
build:remote-ci-macos --config=remote-ci-common
build:remote-ci-macos --host_platform=//ci/platform:macos
build:remote-ci-macos --platforms=//ci/platform:macos
build:remote-ci-macos --extra_execution_platforms=//ci/platform:macos
build:remote-ci-macos --xcode_version_config=//ci:xcode_config
#############################################################################
# remote-ci-debug: Various Bazel debugging flags
#############################################################################
common:remote-ci-debug --announce_rc
common:remote-ci-debug -s
common:remote-ci-debug -c dbg
common:remote-ci-debug --verbose_failures
common:remote-ci-debug --sandbox_debug
common:remote-ci-debug --action_env=VERBOSE_COVERAGE=true
common:remote-ci-debug --test_env=VERBOSE_COVERAGE=true
common:remote-ci-debug --test_env=DISPLAY_LCOV_CMD=true
#############################################################################
# Experimental EngFlow Remote Execution Configs
#############################################################################