Skip to content

Upgrade to abseil-cpp/20260526.0#112

Draft
matthewtlam wants to merge 1 commit into
google:mainfrom
matthewtlam:upgrade-abseil-20260526
Draft

Upgrade to abseil-cpp/20260526.0#112
matthewtlam wants to merge 1 commit into
google:mainfrom
matthewtlam:upgrade-abseil-20260526

Conversation

@matthewtlam

Copy link
Copy Markdown
Contributor

Summary

Upgrades the Bazel dependency graph to abseil-cpp/20260526.0 (from 20240722.0), along with all transitive deps that needed to move to keep up.

What changed

  • abseil-cpp: 20240722.020260526.0
  • protobuf: 29.033.5
  • gutil: 20250502.020260309.0.bcr.1 (dropped grpc dependency)
  • re2: 2024-07-02.bcr.12025-11-05.bcr.1
  • googletest: 1.15.21.17.0.bcr.2
  • fuzztest: 20241028.020260219.0
  • google_benchmark: 1.9.41.9.5

All 17 tests pass.

Non-obvious workarounds

Three separate categories of issues required patches or workarounds:

1. BCR packaging bug: missing compatibility_level

The BCR entry for abseil-cpp/20260526.0 omits compatibility_level = 1 (defaulting to 0), which makes Bazel's MVS treat it as incompatible with any module that declared a dep on an earlier abseil version at compatibility_level = 1. This causes a hard resolution failure.

Fixed by adding a local Bazel registry (registry/) with a corrected MODULE.bazel for abseil, prepended via .bazelrc:

common --registry=file://%workspace%/registry
common --registry=https://bcr.bazel.build

2. BCR packaging bug: missing absl/utility:if_constexpr

abseil-cpp/20260526.0 removed absl/utility:if_constexpr (a pre-C++17 compatibility shim). Protobuf 29 still referenced it, but upgrading protobuf to 30 broke gutil (which requires py_proto_library, removed in protobuf 30). The fix was to add the header and Bazel target back via a source patch in the local registry (registry/modules/abseil-cpp/20260526.0/patches/if_constexpr_compat.patch), restoring backward compatibility without touching protobuf.

3. Layering cleanup: removed transitive include in absl/random/bit_gen_ref.h

abseil-cpp/20260526.0 removed a transitive include of absl/random/internal/distribution_caller.h from bit_gen_ref.h. fuzztest/20260219.0's fuzzing_bit_gen.h had friend declarations for absl::random_internal::DistributionCaller and absl::random_internal::MockHelpers that relied on this transitive exposure. Adding explicit #include or deps wasn't viable (those targets have package-private visibility in abseil). Fixed by forward-declaring the two types directly in fuzzing_bit_gen.h via a single_version_override patch (patches/fuzztest_20260219.0_abseil_random_internal_compat.patch).

abseil-cpp/20260526.0 has two BCR packaging issues that need local
workarounds, plus it introduced breaking API changes that required
upgrading the rest of the dependency stack.

BCR issues fixed via a local registry (registry/):
- Missing `compatibility_level = 1` in the BCR MODULE.bazel entry
  (field defaults to 0, causing Bazel's MVS to reject it).
- Removed `absl/utility:if_constexpr` compat shim (added back via a
  source patch), still referenced by the protobuf 29 build graph.

API breaking changes required upgrading the whole dep stack:
- `absl::Nonnull<T>` template alias removed (replaced by `absl_nonnull`
  attribute); fuzztest 20241028.0 used the old form → bump to 20260219.0.
- `absl/random/bit_gen_ref.h` dropped its transitive include of
  `absl/random/internal/distribution_caller.h`; fuzztest 20260219.0's
  `fuzzing_bit_gen.h` relied on that → patch adds forward declarations.
- gutil 20250502.0 pulled in grpc/googleapis, whose older protobuf usage
  was incompatible with the required protobuf upgrade → bump gutil to
  20260309.0.bcr.1 (which dropped grpc and targets protobuf 33.5).

Dep versions changed:
  abseil-cpp  20240722.0       -> 20260526.0
  protobuf    29.0             -> 33.5
  gutil       20250502.0       -> 20260309.0.bcr.1
  re2         2024-07-02.bcr.1 -> 2025-11-05.bcr.1
  googletest  1.15.2           -> 1.17.0.bcr.2
  fuzztest    20241028.0       -> 20260219.0
  benchmark   1.9.4            -> 1.9.5

All 17 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@google-cla

google-cla Bot commented Jun 22, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants