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
pull/16556/head
Mike Kruskal 8 months ago
parent e67ccf8a0e
commit 16acf7ed86
  1. 6
      .github/workflows/test_cpp.yml
  2. 2
      .github/workflows/test_rust.yml
  3. 4
      .github/workflows/test_upb.yml
  4. 5
      ci/common.bazelrc

@ -31,7 +31,7 @@ jobs:
# Override cases with custom images # Override cases with custom images
- config: { name: "Bazel7" } - config: { name: "Bazel7" }
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.0.0-a04396cc76704d4b7c722789e9c08df18f47df53" image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.1-75f2a85ece6526cc3d54087018c0f1097d78d42b"
targets: "//src/... //third_party/utf8_range/..." targets: "//src/... //third_party/utf8_range/..."
- config: { name: "TCMalloc" } - config: { name: "TCMalloc" }
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/tcmalloc@sha256:bd39119d74b8a3fad4ae335d4cf5294e70384676331b7e19949459fc7a8d8328" image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/tcmalloc@sha256:bd39119d74b8a3fad4ae335d4cf5294e70384676331b7e19949459fc7a8d8328"
@ -328,7 +328,7 @@ jobs:
os: macos-12 os: macos-12
cache_key: macos-12-bazel7 cache_key: macos-12-bazel7
bazel: test //src/... //third_party/utf8_range/... bazel: test //src/... //third_party/utf8_range/...
bazel_version: '7.0.0' bazel_version: '7.1.1'
- name: MacOS Apple Silicon (build only) Bazel - name: MacOS Apple Silicon (build only) Bazel
os: macos-12 os: macos-12
cache_key: macos-12-arm cache_key: macos-12-arm
@ -343,7 +343,7 @@ jobs:
os: windows-2022 os: windows-2022
cache_key: windows-2022-bazel7 cache_key: windows-2022-bazel7
bazel: test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance bazel: test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance
bazel_version: '7.0.0' bazel_version: '7.1.1'
name: ${{ matrix.name }} name: ${{ matrix.name }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:

@ -23,7 +23,7 @@ jobs:
- name: Run tests - name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v2 uses: protocolbuffers/protobuf-ci/bazel-docker@v2
with: with:
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.0.0-a04396cc76704d4b7c722789e9c08df18f47df53" image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.1-75f2a85ece6526cc3d54087018c0f1097d78d42b"
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: rust_linux bazel-cache: rust_linux
bazel: >- bazel: >-

@ -17,7 +17,7 @@ jobs:
fail-fast: false # Don't cancel all jobs if one fails. fail-fast: false # Don't cancel all jobs if one fails.
matrix: matrix:
config: config:
- { name: "Bazel 7", bazel_version: "7.0.0" } - { name: "Bazel 7", bazel_version: "7.1.1" }
- { name: "Fastbuild" } - { name: "Fastbuild" }
- { name: "Optimized", flags: "-c opt" } - { name: "Optimized", flags: "-c opt" }
- { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-//benchmarks:benchmark -//python/...", runner: ubuntu-20-large } - { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-//benchmarks:benchmark -//python/...", runner: ubuntu-20-large }
@ -37,7 +37,7 @@ jobs:
- name: Run tests - name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v2 uses: protocolbuffers/protobuf-ci/bazel-docker@v2
with: with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize:${{ matrix.config.bazel_version || '6.3.0' }}-d07b7d649401d147e71e7182d2832cc8344f1f35 image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize:${{ matrix.config.bazel_version || '6.3.0' }}-75f2a85ece6526cc3d54087018c0f1097d78d42b
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: upb-bazel bazel-cache: upb-bazel
bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upb_generator/... ${{ matrix.config.flags }} bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upb_generator/... ${{ matrix.config.flags }}

@ -28,6 +28,11 @@ build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
# https://github.com/bazelbuild/bazel/issues/11122#issuecomment-613746748 # https://github.com/bazelbuild/bazel/issues/11122#issuecomment-613746748
build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr
# Workaround Bazel 7 remote cache issues.
# See https://github.com/bazelbuild/bazel/issues/20161
build --experimental_remote_cache_eviction_retries=5
build --remote_download_outputs=all
# Build with all --incompatible flags that we can. This helps us prepare for # Build with all --incompatible flags that we can. This helps us prepare for
# upcoming breaking changes in Bazel. This list was generated for Bazel 6 by # upcoming breaking changes in Bazel. This list was generated for Bazel 6 by
# running bazelisk with the --migrate flag and filtering out all flags that # running bazelisk with the --migrate flag and filtering out all flags that

Loading…
Cancel
Save