Skip to content

Commit 16acf7e

Browse files
Fix bazel cache issues in 7.0.0
We're seeing a high flake rate due to remote cache-misses only on Bazel 7 builds. The key change here seems to be adding the remote_download_output flag, but this also upgrades us to 7.1.1 and adds some retry behavior to caching issues. PiperOrigin-RevId: 625892332
1 parent e67ccf8 commit 16acf7e

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.github/workflows/test_cpp.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
# Override cases with custom images
3333
- config: { name: "Bazel7" }
34-
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.0.0-a04396cc76704d4b7c722789e9c08df18f47df53"
34+
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.1-75f2a85ece6526cc3d54087018c0f1097d78d42b"
3535
targets: "//src/... //third_party/utf8_range/..."
3636
- config: { name: "TCMalloc" }
3737
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/tcmalloc@sha256:bd39119d74b8a3fad4ae335d4cf5294e70384676331b7e19949459fc7a8d8328"
@@ -328,7 +328,7 @@ jobs:
328328
os: macos-12
329329
cache_key: macos-12-bazel7
330330
bazel: test //src/... //third_party/utf8_range/...
331-
bazel_version: '7.0.0'
331+
bazel_version: '7.1.1'
332332
- name: MacOS Apple Silicon (build only) Bazel
333333
os: macos-12
334334
cache_key: macos-12-arm
@@ -343,7 +343,7 @@ jobs:
343343
os: windows-2022
344344
cache_key: windows-2022-bazel7
345345
bazel: test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance
346-
bazel_version: '7.0.0'
346+
bazel_version: '7.1.1'
347347
name: ${{ matrix.name }}
348348
runs-on: ${{ matrix.os }}
349349
steps:

.github/workflows/test_rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Run tests
2424
uses: protocolbuffers/protobuf-ci/bazel-docker@v2
2525
with:
26-
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.0.0-a04396cc76704d4b7c722789e9c08df18f47df53"
26+
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.1-75f2a85ece6526cc3d54087018c0f1097d78d42b"
2727
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
2828
bazel-cache: rust_linux
2929
bazel: >-

.github/workflows/test_upb.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false # Don't cancel all jobs if one fails.
1818
matrix:
1919
config:
20-
- { name: "Bazel 7", bazel_version: "7.0.0" }
20+
- { name: "Bazel 7", bazel_version: "7.1.1" }
2121
- { name: "Fastbuild" }
2222
- { name: "Optimized", flags: "-c opt" }
2323
- { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-//benchmarks:benchmark -//python/...", runner: ubuntu-20-large }
@@ -37,7 +37,7 @@ jobs:
3737
- name: Run tests
3838
uses: protocolbuffers/protobuf-ci/bazel-docker@v2
3939
with:
40-
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize:${{ matrix.config.bazel_version || '6.3.0' }}-d07b7d649401d147e71e7182d2832cc8344f1f35
40+
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize:${{ matrix.config.bazel_version || '6.3.0' }}-75f2a85ece6526cc3d54087018c0f1097d78d42b
4141
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
4242
bazel-cache: upb-bazel
4343
bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upb_generator/... ${{ matrix.config.flags }}

ci/common.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
2828
# https://github.com/bazelbuild/bazel/issues/11122#issuecomment-613746748
2929
build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr
3030

31+
# Workaround Bazel 7 remote cache issues.
32+
# See https://github.com/bazelbuild/bazel/issues/20161
33+
build --experimental_remote_cache_eviction_retries=5
34+
build --remote_download_outputs=all
35+
3136
# Build with all --incompatible flags that we can. This helps us prepare for
3237
# upcoming breaking changes in Bazel. This list was generated for Bazel 6 by
3338
# running bazelisk with the --migrate flag and filtering out all flags that

0 commit comments

Comments
 (0)