xref: /aosp_15_r20/bootable/libbootloader/gbl/bazel.bazelrc (revision 5225e6b173e52d2efc6bcf950c27374fd72adabc)
1# Lock down the PATH variable in actions to /usr/bin and /usr/local/bin.
2build --incompatible_strict_action_env
3
4# By default, output all the logs to stdout/stderr by disabling the console limit
5build --experimental_ui_max_stdouterr_bytes=-1
6
7# Make output directories writable so `rm -rf out/` works.
8build --experimental_writable_outputs
9
10# NOTE: To ensure a strict no external access policy, the following three flags
11#   need to be set/unset, see https://github.com/bazelbuild/bazel/discussions/18281
12#   for more details about this.
13# An empty string as argument requests the cache to be disabled.
14common --repository_cache=
15# Additional places to search for archives before accessing the network to download them.
16common --distdir=
17# If set, downloading using ctx.download{,_and_extract} is not allowed during repository fetching.
18common --repository_disable_download
19
20# bzlmod
21common --enable_bzlmod
22common --registry=file://%workspace%/external/bazelbuild-bazel-central-registry
23# Set --lockfile_mode=off to prevent generation of MODULE.bazel.lock
24# and caching of source declarations in the registry.
25# See https://github.com/bazelbuild/bazel/issues/20477
26# Note: If the registry files are modified, one needs to run `bazel shutdown`
27#   as well as setting this flag. Usually, files are only added to the registry.
28common --lockfile_mode=off
29
30# CC toolchain
31# Use --platforms to select toolchains, not the legacy --cpu --cross_top --compiler.
32# See https://bazel.build/concepts/platforms#cxx
33build --incompatible_enable_cc_toolchain_resolution
34
35# Do not use host toolchain
36build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
37
38build --@rules_rust//rust/settings:experimental_toolchain_generated_sysroot=false
39common --extra_toolchains=@gbl//toolchain:all
40test  --test_output=errors
41
42# Set up remote caching
43# https://developers.google.com/remote-build-execution/docs/set-up/set-up-caching
44test:ants --remote_cache=grpcs://remotebuildexecution.googleapis.com
45test:ants --google_default_credentials=true
46test:ants --remote_instance_name=projects/android-build-farm/instances/default_instance
47test:ants --noremote_upload_local_results
48
49# Upload results to BES backend.
50# Refer to go/bazel-ants-docs
51test:ants --bes_backend=buildeventservice-pa.googleapis.com
52test:ants --bes_keywords=android-test-storage
53test:ants --bes_instance_name=android-build-farm
54test:ants --build_metadata=run_type=critical
55
56# Show URI to test results
57test:ants --build_metadata=generate_test_uri=fusion
58
59# These need to be set in the command line
60# test:ants --build_metadata="ab_build_id=${BUILD_ID}"
61# test:ants --build_metadata="ab_target=???",
62# test:ants --build_metadata="test_definition_name=kernel/kleaf/???"
63
64common:android_ci --noshow_progress
65test:android_ci --config=ants
66