blob: 8248d636b3e00c55c47f9b7548ac21279356ed59 [file] [log] [blame]
Tim Windelschmidt6c851e22024-01-11 15:23:48 +01001# Do not upload locally executed action results to the remote cache.
2# This should be the default for local builds so local builds cannot poison the remote cache.
3# It should be flipped to `--remote_upload_local_results` on CI
4# by using `--bazelrc=.aspect/bazelrc/ci.bazelrc`.
5# Docs: https://bazel.build/reference/command-line-reference#flag--remote_upload_local_results
Tim Windelschmidt54a2cf92025-06-25 01:06:37 +02006common --noremote_upload_local_results
Tim Windelschmidt6c851e22024-01-11 15:23:48 +01007
8# Don't allow network access for build actions in the sandbox.
9# Ensures that you don't accidentally make non-hermetic actions/tests which depend on remote
10# services.
11# Developers should tag targets with `tags=["requires-network"]` to opt-out of the enforcement.
12# Docs: https://bazel.build/reference/command-line-reference#flag--sandbox_default_allow_network
Tim Windelschmidt54a2cf92025-06-25 01:06:37 +020013common --sandbox_default_allow_network=false
Tim Windelschmidt6c851e22024-01-11 15:23:48 +010014
15# Warn if a test's timeout is significantly longer than the test's actual execution time.
16# Bazel's default for test_timeout is medium (5 min), but most tests should instead be short (1 min).
17# While a test's timeout should be set such that it is not flaky, a test that has a highly
18# over-generous timeout can hide real problems that crop up unexpectedly.
19# For instance, a test that normally executes in a minute or two should not have a timeout of
20# ETERNAL or LONG as these are much, much too generous.
21# Docs: https://bazel.build/docs/user-manual#test-verbose-timeout-warnings
Tim Windelschmidt54a2cf92025-06-25 01:06:37 +020022common --test_verbose_timeout_warnings
Tim Windelschmidt6c851e22024-01-11 15:23:48 +010023
24# Allow the Bazel server to check directory sources for changes. Ensures that the Bazel server
25# notices when a directory changes, if you have a directory listed in the srcs of some target.
26# Recommended when using
Tim Windelschmidt5d0f6342024-09-25 03:35:00 +020027# [copy_directory](https://github.com/bazel-contrib/bazel-lib/blob/main/docs/copy_directory.md) and
Tim Windelschmidt6c851e22024-01-11 15:23:48 +010028# [rules_js](https://github.com/aspect-build/rules_js) since npm package are source directories
29# inputs to copy_directory actions.
30# Docs: https://bazel.build/reference/command-line-reference#flag--host_jvm_args
31startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1
32
33# Allow exclusive tests to run in the sandbox. Fixes a bug where Bazel doesn't enable sandboxing for
34# tests with `tags=["exclusive"]`.
35# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_exclusive_test_sandboxed
Tim Windelschmidt54a2cf92025-06-25 01:06:37 +020036common --incompatible_exclusive_test_sandboxed
Tim Windelschmidt6c851e22024-01-11 15:23:48 +010037
38# Use a static value for `PATH` and does not inherit `LD_LIBRARY_PATH`. Doesn't let environment
39# variables like `PATH` sneak into the build, which can cause massive cache misses when they change.
40# Use `--action_env=ENV_VARIABLE` if you want to inherit specific environment variables from the
41# client, but note that doing so can prevent cross-user caching if a shared cache is used.
42# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_strict_action_env
Tim Windelschmidt54a2cf92025-06-25 01:06:37 +020043common --incompatible_strict_action_env
Tim Windelschmidt6c851e22024-01-11 15:23:48 +010044
Tim Windelschmidt6c851e22024-01-11 15:23:48 +010045# Do not automatically create `__init__.py` files in the runfiles of Python targets. Fixes the wrong
46# default that comes from Google's internal monorepo by using `__init__.py` to delimit a Python
47# package. Precisely, when a `py_binary` or `py_test` target has `legacy_create_init` set to `auto (the
48# default), it is treated as false if and only if this flag is set. See
49# https://github.com/bazelbuild/bazel/issues/10076.
50# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_default_to_explicit_init_py
Tim Windelschmidt54a2cf92025-06-25 01:06:37 +020051common --incompatible_default_to_explicit_init_py
Tim Windelschmidt6c851e22024-01-11 15:23:48 +010052
53# Set default value of `allow_empty` to `False` in `glob()`. This prevents a common mistake when
54# attempting to use `glob()` to match files in a subdirectory that is opaque to the current package
55# because it contains a BUILD file. See https://github.com/bazelbuild/bazel/issues/8195.
56# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_disallow_empty_glob
57common --incompatible_disallow_empty_glob
58
59# Always download coverage files for tests from the remote cache. By default, coverage files are not
Tim Windelschmidt5d0f6342024-09-25 03:35:00 +020060# downloaded on test result cache hits when --remote_download_minimal is enabled, making it impossible
Tim Windelschmidt6c851e22024-01-11 15:23:48 +010061# to generate a full coverage report.
62# Docs: https://bazel.build/reference/command-line-reference#flag--experimental_fetch_all_coverage_outputs
Tim Windelschmidt54a2cf92025-06-25 01:06:37 +020063# ditching remote cache results
64common --experimental_fetch_all_coverage_outputs