forked from Checkmk/checkmk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bazelrc
97 lines (82 loc) · 3.69 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
# https://docs.bazel.build/versions/main/best-practices.html#using-the-bazelrc-file
try-import %workspace%/user.bazelrc
# default/common bazel args for all commands supporting it
common --experimental_ui_max_stdouterr_bytes=10000000
common --experimental_remote_cache_async
common --remote_cache_compression
# minimum blob size required to compress/decompress with zstd (1MB)
common --experimental_remote_cache_compression_threshold=1048576
common --remote_local_fallback
common --cycles
common --local_resources=cpu=HOST_CPUS-2
common --local_resources=memory=HOST_RAM*.5
# We standardized on Ubuntu, a Debian-based distro, so LSB
common --@//:filesystem_layout=lsb
## For specific commands
# Always require debug info.
# build --copt="-g"
build --flag_alias=cmk_version=//:cmk_version
# For some obscure reason, the re2 project made itself valgrind-dirty by default:
# https://github.com/google/re2/commit/ce6f2884c4b52509fd6c5d12b8f1c40587067784
# Defining the symbol below has a small performance hit, but makes our stuff
# valgrind-clean again, which is a crucial feature for debugging the NEB & CMC!
build --copt="-DRE2_ON_VALGRIND"
clean --async
# all bazel-created temporary and build output files
# clean --expunge
# run ...
test --test_output=all
# Flags for CI builds
# Definition of "bazel x --config=ci -- ..."
## Common
common:ci --color=no
common:ci --show_progress_rate_limit=0
common:ci --show_timestamps
common:ci --memory_profile=bazel-memory.profile
common:ci --extra_toolchains="//omd/packages/toolchain:ci"
common:ci --local_resources=cpu=HOST_CPUS
common:ci --local_resources=memory=HOST_RAM*.67
common:ci --lockfile_mode=error
# No standard in the CI where we must explicitly differentiate between LSB and FHS.
common:ci --@//:filesystem_layout=FILESYSTEM_LAYOUT_INVALID
## For specific commands
# build:ci ...
# Don't require system python for bootstrapping
# See: https://github.com/bazelbuild/rules_python/commit/f5b19dce7bc0837396ac03a425cdb9b64643cf61
# TODO: should be dropped as soon as this becomes the default
# TODO: this should be the overall default, see discussions in
# https://tribe29.slack.com/archives/C03PW9280U9/p1728303949973099
build:ci --@rules_python//python/config_settings:bootstrap_impl=script
# clean:ci ...
# run:ci ...
# test:ci ...
# Flags for Debug builds
# Definition of "bazel x --config=debug -- ..."
## Common
common:debug --sandbox_debug
common:debug --subcommands=pretty_print
common:debug --announce_rc
# gRPC errors provide stack trace as well
common:debug --verbose_failures
## For specific commands
# build:debug ...
# clean:debug ...
# run:debug ...
# test:debug ...
################################################################################
# Example: bazel build --config clang-tidy //packages/cmc:all
################################################################################
build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
build:clang-tidy --output_groups=report
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_executable=//omd/packages/bazel_clang_tidy:clangtidy_bin
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=//omd/packages/bazel_clang_tidy:clang_tidy_config
################################################################################
# Example: bazel build --config=iwyu //packages/cmc:all
################################################################################
build:iwyu --aspects @bazel_iwyu//bazel/iwyu:iwyu.bzl%iwyu_aspect
build:iwyu --output_groups=report
build:iwyu --@bazel_iwyu//:iwyu_executable=//omd/packages/bazel_iwyu:iwyu_bin
build:iwyu --@bazel_iwyu//:iwyu_opts="--error"
build:iwyu --@bazel_iwyu//:iwyu_mappings=//omd/packages/bazel_iwyu:iwyu_mappings
# Must be last
try-import /etc/ci.bazelrc