|
| 1 | +# Generated by bazelrc-preset.bzl |
| 2 | +# To update this file, run: |
| 3 | +# bazel run @@//tools:preset.update |
| 4 | + |
| 5 | +# On CI, announce all announces command options read from the bazelrc file(s) when starting up at the |
| 6 | +# beginning of each Bazel invocation. This is very useful on CI to be able to inspect which flags |
| 7 | +# are being applied on each run based on the order of overrides. |
| 8 | +common:ci --announce_rc |
| 9 | +# Docs: https://registry.build/flag/ [email protected]?filter=announce_rc |
| 10 | + |
| 11 | +# Avoid creating a runfiles tree for binaries or tests until it is needed. |
| 12 | +# See https://github.com/bazelbuild/bazel/issues/6627 |
| 13 | +# This may break local workflows that `build` a binary target, then run the resulting program outside of `bazel run`. |
| 14 | +# In those cases, the script will need to call `bazel build --build_runfile_links //my/binary:target` and then execute the resulting program. |
| 15 | +common --nobuild_runfile_links |
| 16 | +# Docs: https://registry.build/flag/ [email protected]?filter=build_runfile_links |
| 17 | + |
| 18 | +# See https://github.com/bazelbuild/bazel/issues/20577 |
| 19 | +coverage --build_runfile_links |
| 20 | +# Docs: https://registry.build/flag/ [email protected]?filter=build_runfile_links |
| 21 | + |
| 22 | +# Always run tests even if they have cached results. |
| 23 | +# This ensures tests are executed fresh each time, useful for debugging and ensuring test reliability. |
| 24 | +common:debug --nocache_test_results |
| 25 | +# Docs: https://registry.build/flag/ [email protected]?filter=cache_test_results |
| 26 | + |
| 27 | +# Don’t encourage a rules author to update their deps if not needed. |
| 28 | +# These bazel_dep calls should indicate the minimum version constraint of the ruleset. |
| 29 | +# If the author instead updates to the newest of any of their transitives, as this flag would suggest, |
| 30 | +# then they'll also force their dependents to a newer version. |
| 31 | +# Context: |
| 32 | +# https://bazelbuild.slack.com/archives/C014RARENH0/p1691158021917459?thread_ts=1691156601.420349&cid=C014RARENH0 |
| 33 | +common:ruleset --check_direct_dependencies="off" |
| 34 | +# Docs: https://registry.build/flag/ [email protected]?filter=check_direct_dependencies |
| 35 | + |
| 36 | +# On CI, use colors to highlight output on the screen. Set to `no` if your CI does not display colors. |
| 37 | +common:ci --color="yes" |
| 38 | +# Docs: https://registry.build/flag/ [email protected]?filter=color |
| 39 | + |
| 40 | +# On CI, use cursor controls in screen output. |
| 41 | +common:ci --curses="yes" |
| 42 | +# Docs: https://registry.build/flag/ [email protected]?filter=curses |
| 43 | + |
| 44 | +# Bazel picks up host-OS-specific config lines from bazelrc files. For example, if the host OS is |
| 45 | +# Linux and you run bazel build, Bazel picks up lines starting with build:linux. Supported OS |
| 46 | +# identifiers are `linux`, `macos`, `windows`, `freebsd`, and `openbsd`. Enabling this flag is |
| 47 | +# equivalent to using `--config=linux` on Linux, `--config=windows` on Windows, etc. |
| 48 | +common --enable_platform_specific_config |
| 49 | +# Docs: https://registry.build/flag/ [email protected]?filter=enable_platform_specific_config |
| 50 | + |
| 51 | +# Speed up all builds by not checking if external repository files have been modified. |
| 52 | +# For reference: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java#L244 |
| 53 | +common --noexperimental_check_external_repository_files |
| 54 | +# Docs: https://registry.build/flag/ [email protected]?filter=experimental_check_external_repository_files |
| 55 | + |
| 56 | +# Always download coverage files for tests from the remote cache. By default, coverage files are not |
| 57 | +# downloaded on test result cache hits when --remote_download_minimal is enabled, making it impossible |
| 58 | +# to generate a full coverage report. |
| 59 | +common --experimental_fetch_all_coverage_outputs |
| 60 | +# Docs: https://registry.build/flag/ [email protected]?filter=experimental_fetch_all_coverage_outputs |
| 61 | + |
| 62 | +# This flag was added in Bazel 6.2.0 with a default of zero: |
| 63 | +# https://github.com/bazelbuild/bazel/commit/24b45890c431de98d586fdfe5777031612049135 |
| 64 | +# For Bazel 8.0.0rc1 the default was changed to 5: |
| 65 | +# https://github.com/bazelbuild/bazel/commit/739e37de66f4913bec1a55b2f2a162e7db6f2d0f |
| 66 | +# Back-port the updated flag default value to older Bazel versions. |
| 67 | +common --experimental_remote_cache_eviction_retries=5 |
| 68 | +# Docs: https://registry.build/flag/ [email protected]?filter=experimental_remote_cache_eviction_retries |
| 69 | + |
| 70 | +# This flag was added in Bazel 5.0.0 with a default of zero: |
| 71 | +# https://github.com/bazelbuild/bazel/commit/a1137ec1338d9549fd34a9a74502ffa58c286a8e |
| 72 | +# For Bazel 8.0.0 the default was changed to 5: |
| 73 | +# https://github.com/bazelbuild/bazel/commit/9335cf989ee6a678ca10bc4da72214634cef0a57 |
| 74 | +# Back-port the updated flag default value to older Bazel versions. |
| 75 | +common --experimental_repository_downloader_retries=5 |
| 76 | +# Docs: https://registry.build/flag/ [email protected]?filter=experimental_repository_downloader_retries |
| 77 | + |
| 78 | +# Set this flag to enable re-tries of failed tests on CI. |
| 79 | +# When any test target fails, try one or more times. This applies regardless of whether the "flaky" |
| 80 | +# tag appears on the target definition. |
| 81 | +# This is a tradeoff: legitimately failing tests will take longer to report, |
| 82 | +# but we can "paper over" flaky tests that pass most of the time. |
| 83 | +# |
| 84 | +# An alternative is to mark every flaky test with the `flaky = True` attribute, but this requires |
| 85 | +# the buildcop to make frequent code edits. |
| 86 | +# This flag is not recommended for local builds: flakiness is more likely to get fixed if it is |
| 87 | +# observed during development. |
| 88 | +# |
| 89 | +# Note that when passing after the first attempt, Bazel will give a special "FLAKY" status rather than "PASSED". |
| 90 | +test:ci --flaky_test_attempts=2 |
| 91 | +# Docs: https://registry.build/flag/ [email protected]?filter=flaky_test_attempts |
| 92 | + |
| 93 | +# Fixes builds hanging on CI that get the TCP connection closed without sending RST packets. |
| 94 | +common:ci --grpc_keepalive_time="30s" |
| 95 | +# Docs: https://registry.build/flag/ [email protected]?filter=grpc_keepalive_time |
| 96 | + |
| 97 | +# Output a heap dump if an OOM is thrown during a Bazel invocation |
| 98 | +# (including OOMs due to `--experimental_oom_more_eagerly_threshold`). |
| 99 | +# The dump will be written to `<output_base>/<invocation_id>.heapdump.hprof`. |
| 100 | +# You should configure CI to upload this artifact for later inspection. |
| 101 | +common --heap_dump_on_oom |
| 102 | +# Docs: https://registry.build/flag/ [email protected]?filter=heap_dump_on_oom |
| 103 | + |
| 104 | +# Allow the Bazel server to check directory sources for changes. Ensures that the Bazel server |
| 105 | +# notices when a directory changes, if you have a directory listed in the srcs of some target. |
| 106 | +# Recommended when using [copy_directory](https://github.com/bazel-contrib/bazel-lib/blob/main/docs/copy_directory.md) |
| 107 | +# and [rules_js](https://github.com/aspect-build/rules_js) since npm package are source directories inputs to copy_directory actions. |
| 108 | +startup --host_jvm_args="-DBAZEL_TRACK_SOURCE_DIRECTORIES=1" |
| 109 | +# Docs: https://registry.build/flag/ [email protected]?filter=host_jvm_args |
| 110 | + |
| 111 | +# By default, Bazel automatically creates __init__.py files for py_binary and py_test targets. |
| 112 | +# From https://github.com/bazelbuild/bazel/issues/10076: |
| 113 | +# > It is magic at a distance. |
| 114 | +# > Python programmers are already used to creating __init__.py files in their source trees, |
| 115 | +# > so doing it behind their backs introduces confusion and changes the semantics of imports |
| 116 | +common --incompatible_default_to_explicit_init_py |
| 117 | +# Docs: https://registry.build/flag/ [email protected]?filter=incompatible_default_to_explicit_init_py |
| 118 | + |
| 119 | +# Disallow empty glob patterns. |
| 120 | +# The glob() function tends to be error-prone, because any typo in a path will silently return an empty list. |
| 121 | +# This flag was added in Bazel 0.27 and flipped in Bazel 8: https://github.com/bazelbuild/bazel/issues/8195 |
| 122 | +common --incompatible_disallow_empty_glob |
| 123 | +# Docs: https://registry.build/flag/ [email protected]?filter=incompatible_disallow_empty_glob |
| 124 | + |
| 125 | +# Make builds more reproducible by using a static value for PATH and not inheriting LD_LIBRARY_PATH. |
| 126 | +# Use `--action_env=ENV_VARIABLE` if you want to inherit specific variables from the environment where Bazel runs. |
| 127 | +# Note that doing so can prevent cross-user caching if a shared cache is used. |
| 128 | +# See https://github.com/bazelbuild/bazel/issues/2574 for more details. |
| 129 | +common --incompatible_strict_action_env |
| 130 | +# Docs: https://registry.build/flag/ [email protected]?filter=incompatible_strict_action_env |
| 131 | + |
| 132 | +# Performance improvement: avoid laying out a second copy of the runfiles tree. |
| 133 | +# See https://github.com/bazelbuild/bazel/issues/23574. |
| 134 | +# This flag was flipped for Bazel 8. |
| 135 | +common --nolegacy_external_runfiles |
| 136 | +# Docs: https://registry.build/flag/ [email protected]?filter=legacy_external_runfiles |
| 137 | + |
| 138 | +# On CI, don't download remote outputs to the local machine. |
| 139 | +# Most CI pipelines don't need to access the files and they can remain at rest on the remote cache. |
| 140 | +# Significant time can be spent on needless downloads, which is especially noticeable on fully-cached builds. |
| 141 | +# |
| 142 | +# If you do need to download files, the fastest options are: |
| 143 | +# - (preferred) Use `remote_download_regex` to specify the files to download. |
| 144 | +# - Use the Remote Output Service (https://blog.bazel.build/2024/07/23/remote-output-service.html) |
| 145 | +# to lazy-materialize specific files after the build completes. |
| 146 | +# - Perform a second bazel command with specific targets and override this flag with the `toplevel` value. |
| 147 | +# - To copy executable targets, you can use `bazel run --run_under=cp //some:binary_target <destination path>`. |
| 148 | +common:ci --remote_download_outputs="minimal" |
| 149 | +# Docs: https://registry.build/flag/ [email protected]?filter=remote_download_outputs |
| 150 | + |
| 151 | +# On CI, fall back to standalone local execution strategy if remote execution fails. |
| 152 | +# Otherwise, when a grpc remote cache connection fails, it would fail the build. |
| 153 | +common:ci --remote_local_fallback |
| 154 | +# Docs: https://registry.build/flag/ [email protected]?filter=remote_local_fallback |
| 155 | + |
| 156 | +# On CI, extend the maximum amount of time to wait for remote execution and cache calls. |
| 157 | +common:ci --remote_timeout=3600 |
| 158 | +# Docs: https://registry.build/flag/ [email protected]?filter=remote_timeout |
| 159 | + |
| 160 | +# Do not upload locally executed action results to the remote cache. |
| 161 | +# This should be the default for local builds so local builds cannot poison the remote cache. |
| 162 | +# |
| 163 | +# Note that this flag is flipped to True under --config=ci, see below. |
| 164 | +common --noremote_upload_local_results |
| 165 | +# Docs: https://registry.build/flag/ [email protected]?filter=remote_upload_local_results |
| 166 | + |
| 167 | +# On CI, upload locally executed action results to the remote cache. |
| 168 | +common:ci --remote_upload_local_results |
| 169 | +# Docs: https://registry.build/flag/ [email protected]?filter=remote_upload_local_results |
| 170 | + |
| 171 | +# Repository rules, such as rules_jvm_external: put Bazel's JDK on the path. |
| 172 | +# Avoids non-hermeticity from dependency on a JAVA_HOME pointing at a system JDK |
| 173 | +# see https://github.com/bazelbuild/rules_jvm_external/issues/445 |
| 174 | +common --repo_env="JAVA_HOME=../bazel_tools/jdk" |
| 175 | +# Docs: https://registry.build/flag/ [email protected]?filter=repo_env |
| 176 | + |
| 177 | +# Reuse sandbox directories between invocations. |
| 178 | +# Directories used by sandboxed non-worker execution may be reused to avoid unnecessary setup costs. |
| 179 | +# Saves time on sandbox creation and deletion when many of the same kind of action is spawned during the build. |
| 180 | +common --reuse_sandbox_directories |
| 181 | +# Docs: https://registry.build/flag/ [email protected]?filter=reuse_sandbox_directories |
| 182 | + |
| 183 | +# Don't allow network access for build actions in the sandbox by default. |
| 184 | +# Avoids accidental non-hermeticity in actions/tests which depend on remote services. |
| 185 | +# Developers should tag targets with `tags=["requires-network"]` to be explicit that they need network access. |
| 186 | +# Note that the sandbox cannot print a message to the console if it denies network access, |
| 187 | +# so failures under this flag appear as application errors in the networking layer. |
| 188 | +common --nosandbox_default_allow_network |
| 189 | +# Docs: https://registry.build/flag/ [email protected]?filter=sandbox_default_allow_network |
| 190 | + |
| 191 | +# Only show progress every 60 seconds on CI. |
| 192 | +# We want to find a compromise between printing often enough to show that the build isn't stuck, |
| 193 | +# but not so often that we produce a long log file that requires a lot of scrolling. |
| 194 | +common:ci --show_progress_rate_limit=60 |
| 195 | +# Docs: https://registry.build/flag/ [email protected]?filter=show_progress_rate_limit |
| 196 | + |
| 197 | +# The printed files are convenient strings for copy+pasting to the shell, to execute them. |
| 198 | +# This option requires an integer argument, which is the threshold number of targets above which result information is not printed. |
| 199 | +# Show the output files created by builds that requested more than one target. |
| 200 | +# This helps users locate the build outputs in more cases. |
| 201 | +common --show_result=20 |
| 202 | +# Docs: https://registry.build/flag/ [email protected]?filter=show_result |
| 203 | + |
| 204 | +# On CI, add a timestamp to each message generated by Bazel specifying the time at which the message was displayed. |
| 205 | +# This makes it easier to reason about what were the slowest steps on CI. |
| 206 | +common:ci --show_timestamps |
| 207 | +# Docs: https://registry.build/flag/ [email protected]?filter=show_timestamps |
| 208 | + |
| 209 | +# The terminal width in columns. Configure this to override the default value based on what your CI system renders. |
| 210 | +common:ci --terminal_columns=143 |
| 211 | +# Docs: https://registry.build/flag/ [email protected]?filter=terminal_columns |
| 212 | + |
| 213 | +# Output test errors to stderr so users don't have to `cat` or open test failure log files when test fail. |
| 214 | +# This makes the log noisier in exchange for reducing the time-to-feedback on test failures for users. |
| 215 | +common --test_output="errors" |
| 216 | +# Docs: https://registry.build/flag/ [email protected]?filter=test_output |
| 217 | + |
| 218 | +# Stream stdout/stderr output from each test in real-time. |
| 219 | +# This provides immediate feedback during test execution, useful for debugging test failures. |
| 220 | +common:debug --test_output="streamed" |
| 221 | +# Docs: https://registry.build/flag/ [email protected]?filter=test_output |
| 222 | + |
| 223 | +# Run one test at a time in exclusive mode. |
| 224 | +# This prevents test interference and provides clearer output when debugging test issues. |
| 225 | +common:debug --test_strategy="exclusive" |
| 226 | +# Docs: https://registry.build/flag/ [email protected]?filter=test_strategy |
| 227 | + |
| 228 | +# The default test_summary ("short") prints a result for every test target that was executed. |
| 229 | +# In a large repo this amounts to hundreds of lines of additional log output when testing a broad wildcard pattern like //... |
| 230 | +# This value means to print information only about unsuccessful tests that were run. |
| 231 | +test:ci --test_summary="terse" |
| 232 | +# Docs: https://registry.build/flag/ [email protected]?filter=test_summary |
| 233 | + |
| 234 | +# Prevent long running tests from timing out. |
| 235 | +# Set to a high value to allow tests to complete even if they take longer than expected. |
| 236 | +common:debug --test_timeout=9999 |
| 237 | +# Docs: https://registry.build/flag/ [email protected]?filter=test_timeout |
0 commit comments