From 4e14918993d29ec4749fc596fb6bfd9b930d8699 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Wed, 2 Sep 2026 00:41:02 -0700 Subject: [PATCH] build: configure repository cache in .bazelrc Configure a shared repository cache and enable hardlinks for local builds to avoid re-downloading external dependencies and save disk space. CI continues to disable hardlinks to work around a Bazel 7 issue. --- .bazelrc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.bazelrc b/.bazelrc index cd41961452..12d1b33865 100644 --- a/.bazelrc +++ b/.bazelrc @@ -36,9 +36,6 @@ common --enable_platform_specific_config # See https://github.com/bazel-contrib/rules_python/issues/3655 common --incompatible_strict_action_env=false -# To work around bug on bazel 7 -common:ci --experimental_repository_cache_hardlinks=false - # Windows makes use of runfiles for some rules build --enable_runfiles @@ -47,13 +44,17 @@ common --enable_bzlmod # Local disk cache greatly speeds up builds if the regular cache is lost common --disk_cache=~/.cache/bazel/bazel-disk-cache +# Shared repository cache avoids re-downloading external dependencies across workspaces +common --repository_cache=~/.cache/bazel/bazel-repo-cache +# Hardlinks save disk space and copy time when unpacking repositories +common --experimental_repository_cache_hardlinks=true +# To work around bug on bazel 7 +common:ci --experimental_repository_cache_hardlinks=false # Drop `experimental_` prefix once Bazel 7 is no longer supported common --experimental_downloader_config=downloader_config.cfg common --http_timeout_scaling=10.0 common --experimental_repository_downloader_retries=10 - - # Additional config to use for readthedocs builds. # See .readthedocs.yml for additional flags that can only be determined from # the runtime environment.