bazel: Add remote_cache config
Copy-pasted from pigweed.git.
Change-Id: I935b811d32f6dba7bac567e915a3af79ac7b6e30
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/experimental/+/238478
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Pigweed-Auto-Submit: Ted Pudlik <tpudlik@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
GitOrigin-RevId: fe93ea8289d39df8f737d5dde4b9e85cf3bf3996
diff --git a/.bazelrc b/.bazelrc
index 6cc0292..40b8caa 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -45,6 +45,21 @@
# "@rules_python//python:exec_tools_toolchain_type").
build --@rules_python//python/config_settings:exec_tools_toolchain=enabled
+# Remote execution config definitions
+# ===================================
+# Use the remote cache. This will only work for users who have permission to access it.
+common:remote_cache --remote_cache=grpcs://remotebuildexecution.googleapis.com
+common:remote_cache --google_default_credentials=true
+common:remote_cache --remote_instance_name=projects/pigweed-rbe-open/instances/default-instance
+common:remote_cache --remote_upload_local_results=false
+common:remote_cache --bes_backend="buildeventservice.googleapis.com"
+# Required to use buildeventservice on Bazel 8+.
+# TODO: b/345556899 -- Remove this flag when no longer required.
+common:remote_cache --legacy_important_outputs
+common:remote_cache --bes_timeout=600s
+common:remote_cache --bes_results_url="https://source.cloud.google.com/results/invocations/"
+common:remote_cache --bes_instance_name=pigweed-rbe-open
+
# User bazelrc file; see
# https://bazel.build/configure/best-practices#bazelrc-file
#