pixie

Форк
0
/
.bazelrc 
271 строка · 11.7 Кб
1
# Global bazelrc file, see https://docs.bazel.build/versions/master/guide.html#bazelrc.
2

3
# Use strict action env to prevent leaks of env vars.
4
build --incompatible_strict_action_env
5

6
# Only pass through GH_API_KEY for stamped builds.
7
# This is still not ideal as it still busts the cache of stamped builds.
8
build:stamp --stamp
9
build:stamp --action_env=GH_API_KEY
10

11
# Doesn't rely on a localjdk which is default. This removes the need for a JAVA_HOME
12
# on the build machine and also makes JAVA builds hermetic.
13
build --java_runtime_version=remotejdk_11
14
test --java_runtime_version=remotejdk_11
15

16
# https://github.com/bazelbuild/rules_jvm_external/issues/445
17
common --repo_env=JAVA_HOME=../bazel_tools/jdk
18

19
build --remote_download_minimal
20
test --remote_download_minimal
21
run --remote_download_outputs=all
22
coverage --build_runfile_links
23

24
# Needed by rules_meta.
25
# Follow https://github.com/fmeum/rules_meta/issues/1#issuecomment-1255828109
26
# for updates.
27
common --incompatible_remove_rule_name_parameter=false
28

29
# Get version information into the build.
30
build --workspace_status_command=bazel/get_workspace_status.sh
31

32
# We only have support for python3 on the Ubuntu 20.04 image.
33
build --host_force_python=PY3
34

35
# Limit memory for JVM to reduce runaway usage.
36
startup --host_jvm_args=-Xmx1900m
37

38
# For all builds, by default, exclude tests that require root or BPF privileges.
39
# To run a test that was filtered out:
40
# bazel test //path/to:test --test_tag_filter=
41
# Which reset the filter to empty.
42
build --test_tag_filters=-requires_root,-requires_bpf,-disabled
43

44
# Sets the default Apple platform to macOS.
45
build --apple_platform_type=macos
46

47
# Keep debug symbols (required for go binaries).
48
# Unfortunately, this affects C++ with -c fastbuild too.
49
# Upgrading io_bazel_rules_go provides a better way to do this, but that upgrade is a tangled web.
50
# TODO(oazizi): Remove after upgrading io_bazel_rules_go.
51
build --strip=never
52

53
# Give each sandbox its own tmp directory.
54
# This is important for //src/stirling/utils:java_test, which otherwise creates conflicting writes
55
# when multiple instances are running simultaneously.
56
# It is also generally not a bad idea, since it improves heremeticity.
57
# For more context, see: https://github.com/bazelbuild/bazel/issues/3236
58
# We can't use this for qemu because it breaks the 9p fs. Since we can't
59
# remove these flags we just set them for all our configs.
60
test:tmp-sandbox --sandbox_tmpfs_path=/tmp
61

62
# This flag prevents rules_docker from transitioning the platform for our images.
63
# Since our target platform is the same as the containers we use,
64
# it doesn't make sense to transition, and results in duplicate builds of targets.
65
build --@io_bazel_rules_docker//transitions:enable=false
66

67
# This flag is equivalent to --config=linux on a linux machine, and --config=macos on a macos machine.
68
common --enable_platform_specific_config
69

70
# Linux specific config
71
# `bazel query` will try to auto-detect the toolchain without this.
72
common:linux --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
73
# --platforms is only set on linux, because we don't have a linux cross-compiling setup on macos.
74
build:linux --platforms=//bazel/cc_toolchains:linux-x86_64
75
# Likewise, we only have cc_toolchain definitions for our linux compilers, so we only enable toolchain resolution on linux.
76
build:linux --incompatible_enable_cc_toolchain_resolution
77
build:linux --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
78

79
# Common options from clang.
80
build:clang-base --//bazel/cc_toolchains:compiler=clang
81
build:clang-base --//bazel/cc_toolchains:libc_version=glibc_host
82

83
# We build our own chroot for the sysroot tests, which doesn't work well under bazel's sandbox.
84
build:sysroot-base --//bazel/test_runners:test_runner=sysroot_chroot
85
test:sysroot-base --strategy TestRunner=standalone
86
test:sysroot-base --run_under="bazel/test_runners/sysroot_chroot/test_runner.sh"
87

88
build:x86_64_sysroot --config=clang
89
build:x86_64_sysroot --//bazel/cc_toolchains:libc_version=glibc2_36
90
build:x86_64_sysroot --config=sysroot-base
91

92
build:aarch64_sysroot --config=clang
93
build:aarch64_sysroot --//bazel/cc_toolchains:libc_version=glibc2_36
94
build:aarch64_sysroot --platforms=//bazel/cc_toolchains:linux-aarch64
95
build:aarch64_sysroot --config=sysroot-base
96
# Increase test timeouts for qemu (don't increase the slowest ones because those are already very long).
97
test:aarch64_sysroot --test_timeout=180,600,1800,3600
98
test:aarch64_sysroot --test_env=QEMU_STRACE
99
test:aarch64_sysroot --test_tag_filters=-no_libcpp,-requires_root,-requires_bpf,-disabled,-requires_full_qemu_emulation
100

101
# Build for Clang using Libc++.
102
build:clang --config=clang-base
103
build:clang --//bazel:enable_libcpp
104
build:clang --features=libc++ --features=-libstdc++
105
build:clang --build_tag_filters=-no_libcpp
106
build:clang --test_tag_filters=-no_libcpp,-requires_root,-requires_bpf,-disabled
107
test:clang --config=tmp-sandbox
108

109
# Build for Clang with libstdc++:
110
build:clang-libstdc++ --config=clang-base
111
build:clang-libstdc++ --//bazel/cc_toolchains:compiler=clang
112
build:clang-libstdc++ --//bazel/cc_toolchains:libc_version=gnu
113
test:clang-libstdc++ --config=tmp-sandbox
114

115
build:qemu-bpf --config=clang-base
116
build:qemu-bpf --//bazel:enable_libcpp
117
build:qemu-bpf --features=libc++ --features=-libstdc++
118
build:qemu-bpf --build_tag_filters=requires_bpf,requires_root,-no_qemu,-no_libcpp
119
build:qemu-bpf --test_tag_filters=requires_bpf,requires_root,-no_qemu,-no_libcpp,-disabled
120
build:qemu-bpf --sandbox_fake_username
121
build:qemu-bpf --//bazel/cc_toolchains:libc_version=glibc2_36
122
build:qemu-bpf --//bazel/test_runners:test_runner=qemu_with_kernel
123
build:qemu-bpf --run_under="bazel/test_runners/qemu_with_kernel/test_runner.sh"
124
test:qemu-bpf --test_timeout=180,600,1800,3600
125

126
# Build for GCC.
127
# These are copts because they apply to both c++ and c files.
128
# In particular, upb is has issues with this that will hopefully be
129
# fixed upstream soon.
130
build:gcc --copt -Wno-error=sign-compare
131
build:gcc --copt -Wno-error=stringop-truncation
132
build:gcc --copt -Wno-error=maybe-uninitialized
133
build:gcc --build_tag_filters=-no_gcc,-qemu_interactive
134
build:gcc --test_tag_filters=-no_gcc,-requires_root,-requires_bpf,-disabled,-qemu_interactive
135
build:gcc --//bazel/cc_toolchains:compiler=gcc
136
# TODO(#1462): Investigate why tcmalloc breaks linking of go binaries.
137
build:gcc --define tcmalloc=disabled
138
test:gcc --config=tmp-sandbox
139

140

141
# bazel build --config asan ...
142
build:asan --config=clang
143
build:asan --//bazel:sanitizer=asan
144
build:asan --features=asan
145
build:asan --test_timeout="120,600,1800,3600"
146
build:asan --define PL_CONFIG_ASAN=1
147
build:asan --define tcmalloc=disabled
148
build:asan --build_tag_filters=-no_asan
149
build:asan --test_tag_filters=-no_asan,-requires_root,-requires_bpf,-disabled
150
build:asan --define signal_trace=disabled
151
build:asan --test_env=ASAN_SYMBOLIZER_PATH
152
build:asan --test_env=ASAN_OPTIONS=handle_abort=1:allow_addr2line=true
153
build:asan --test_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
154
build:asan --define tcmalloc=disabled
155
#test:asan --test_env=ASAN_OPTIONS=detect_container_overflow=0
156

157
# bazel build --config msan
158
build:msan --config=clang
159
build:msan --define PL_CONFIG_MSAN=1
160
build:msan --//bazel:sanitizer=msan
161
build:msan --define tcmalloc=disabled
162
build:msan --build_tag_filters=-no_msan
163
build:msan --test_tag_filters=-no_msan,-requires_root,-requires_bpf,-disabled
164
build:msan --features=msan
165

166
# bazel build --config tsan
167
build:tsan --config=clang
168
build:tsan --//bazel:sanitizer=tsan
169
build:tsan --define PL_CONFIG_TSAN=1
170
build:tsan --define tcmalloc=disabled
171
build:tsan --build_tag_filters=-no_tsan
172
build:tsan --test_tag_filters=-no_tsan,-requires_root,-requires_bpf,-disabled
173
build:tsan --define tcmalloc=disabled
174
# This is needed to address false positive problem with abseil.
175
# https://github.com/google/sanitizers/issues/953
176
build:tsan --test_env=TSAN_OPTIONS=report_atomic_races=0
177
build:tsan --features=tsan
178
test:tsan --test_timeout=180,600,1800,3600
179

180
# Note that we are lumping tests that require root into the BPF tests below
181
# to minimize number of configs.
182
# If there are ever a lot of tests with requires_root, a new config is warranted.
183
# See also ci/bazel_build_deps.sh
184

185
# Note 2: BPF tests are limited to --jobs=4, because otherwise the parallel tests
186
# cause a lot of flakiness. In particular, many of the BPF tests deploy containers,
187
# and the sudden deployment of too many containers causes some containers to get
188
# stuck for minutes without actually running.
189

190
# bazel build --config bpf
191
build:bpf --config=clang
192
build:bpf --build_tag_filters=requires_bpf,requires_root
193
build:bpf --test_tag_filters=requires_bpf,requires_root,-disabled
194
test:bpf --strategy=TestRunner=standalone
195

196
# bazel build --config bpf_asan
197
# Need to repeat the negative build_tag_filters from config=asan,
198
# because the positive build_tag_filters here can re-enable such tests.
199
build:bpf_asan --config=asan
200
build:bpf_asan --build_tag_filters=requires_bpf,requires_root,-no_asan
201
build:bpf_asan --test_tag_filters=requires_bpf,requires_root,-no_asan,-disabled
202
test:bpf_asan --jobs=4 --strategy=TestRunner=standalone
203

204
# bazel build --config bpf_tsan
205
# Need to repeat the negative build_tag_filters from config=tsan,
206
# because the positive build_tag_filters here can re-enable such tests.
207
build:bpf_tsan --config=tsan
208
build:bpf_tsan --build_tag_filters=requires_bpf,requires_root,-no_tsan
209
build:bpf_tsan --test_tag_filters=requires_bpf,requires_root,-no_tsan,-disabled
210
test:bpf_tsan --jobs=4 --strategy=TestRunner=standalone
211

212
# bazel build --config go_race
213
build:go_race --config=clang
214
build:go_race --define tcmalloc=disabled
215
build:go_race --@io_bazel_rules_go//go/config:race
216
test:go_race --define tcmalloc=disabled
217
test:go_race --@io_bazel_rules_go//go/config:race
218
run:go_race --define tcmalloc=disabled
219
run:go_race --@io_bazel_rules_go//go/config:race
220

221

222
coverage --config=gcc
223
coverage --cxxopt -fprofile-arcs
224
coverage --cxxopt -ftest-coverage
225
coverage --instrument_test_targets
226
coverage --define PL_COVERAGE=true
227
coverage --copt -DPL_COVERAGE
228
coverage --test_tag_filters=-requires_root,-requires_bpf,-no_coverage,-disabled,-no_gcc
229
coverage --action_env=COVERAGE_GCOV_OPTIONS=-b
230

231

232
try-import %workspace%/bes.bazelrc
233
# jenkins.bazelrc is copied from ci/jenkins.bazelrc by Jenkins workers during the build.
234
# The intention is to avoid polluting configurations of bazel for developers.
235
try-import %workspace%/jenkins.bazelrc
236
# github.bazelrc is copied from ci/github/bazelrc by the github action workers during the build.
237
try-import %workspace%/github.bazelrc
238

239
# Import a machine specific bazelrc. This can be used to enable caching.
240
try-import /etc/bazelrc
241

242
# Put your own configurations into user.bazelrc, which is ignored by git.
243
try-import %workspace%/user.bazelrc
244

245
# Tensorflow requires this option
246
common --experimental_repo_remote_exec
247

248
# Try Stirling flakes more than the default 3 times.
249
test --flaky_test_attempts=//src/stirling/source_connectors/socket_tracer/.*bpf_test@5
250

251
# Disable XNNPACK for tensorflow lite. There's currently an ASAN issue with XNNPACK, so disable for now.
252
build --define=tflite_with_xnnpack=false
253

254
build:remote --remote_executor=grpcs://remote.buildbuddy.io
255
build:remote --host_platform=//bazel:remote_exec_platform
256
build:remote --extra_execution_platforms=//bazel:remote_exec_platform
257
build:remote --bes_results_url=https://app.buildbuddy.io/invocation/
258
build:remote --bes_backend=grpcs://remote.buildbuddy.io
259
build:remote --remote_cache=grpcs://remote.buildbuddy.io
260
build:remote --experimental_remote_downloader=grpcs://remote.buildbuddy.io
261
build:remote --remote_timeout=1h
262
build:remote --remote_retries=5
263
build:remote --spawn_strategy=remote,local
264
build:remote --experimental_remote_cache_compression
265
build:remote --jobs=100
266
test:remote --jobs=100
267
build:remote --nolegacy_important_outputs
268
build:remote --build_metadata=VISIBILITY=PUBLIC
269
coverage:remote --strategy=CoverageReport=local,remote
270
coverage:remote --experimental_fetch_all_coverage_outputs
271
coverage:remote --experimental_split_coverage_postprocessing
272

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.