Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Use our local registry first so the fixed abseil-cpp 20260526.0 entry
# (with compatibility_level = 1) takes precedence over the broken BCR entry.
common --registry=file://%workspace%/registry
common --registry=https://bcr.bazel.build

# Use C++ 20.
build --cxxopt=-std=c++20
build --host_cxxopt=-std=c++20
Expand Down
25 changes: 18 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,24 @@ module(
compatibility_level = 1,
)

bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf")
bazel_dep(name = "abseil-cpp", version = "20240722.0", repo_name = "com_google_absl")
bazel_dep(name = "gutil", version = "20250502.0", repo_name = "com_google_gutil")
bazel_dep(name = "re2", version = "2024-07-02.bcr.1", repo_name = "com_googlesource_code_re2")
bazel_dep(name = "protobuf", version = "33.5", repo_name = "com_google_protobuf")
bazel_dep(name = "abseil-cpp", version = "20260526.0", repo_name = "com_google_absl")
bazel_dep(name = "gutil", version = "20260309.0.bcr.1", repo_name = "com_google_gutil")
bazel_dep(name = "re2", version = "2025-11-05.bcr.1", repo_name = "com_googlesource_code_re2")

# Dev Depdencies.
bazel_dep(name = "rules_license", version = "1.0.0", dev_dependency = True)
bazel_dep(name = "googletest", version = "1.15.2", dev_dependency = True, repo_name = "com_google_googletest")
bazel_dep(name = "fuzztest", version = "20241028.0", dev_dependency = True, repo_name = "com_google_fuzztest")
bazel_dep(name = "google_benchmark", version = "1.9.4", dev_dependency = True, repo_name = "com_google_benchmark")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2", dev_dependency = True, repo_name = "com_google_googletest")
bazel_dep(name = "fuzztest", version = "20260219.0", dev_dependency = True, repo_name = "com_google_fuzztest")
bazel_dep(name = "google_benchmark", version = "1.9.5", dev_dependency = True, repo_name = "com_google_benchmark")

# fuzztest 20260219.0 relies on a transitive include of
# absl/random/internal/distribution_caller.h via absl/random/bit_gen_ref.h,
# which was removed in abseil 20260526.0 as a layering cleanup. Patch it to
# forward-declare those types directly so the friend declarations compile.
single_version_override(
module_name = "fuzztest",
patches = ["//patches:fuzztest_20260219.0_abseil_random_internal_compat.patch"],
patch_strip = 0,
version = "20260219.0",
)
1 change: 1 addition & 0 deletions patches/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports_files(glob(["*.patch"]))
22 changes: 22 additions & 0 deletions patches/fuzztest_20260219.0_abseil_random_internal_compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git fuzztest/fuzzing_bit_gen.h fuzztest/fuzzing_bit_gen.h
--- fuzztest/fuzzing_bit_gen.h
+++ fuzztest/fuzzing_bit_gen.h
@@ -24,6 +24,18 @@
#include "absl/random/bit_gen_ref.h"
#include "absl/types/span.h"

+
+// Forward-declare internal abseil types used for friend access below.
+// These were transitively declared via absl/random/bit_gen_ref.h in abseil
+// versions before 20260526.0, but that transitive exposure was removed.
+namespace absl {
+namespace random_internal {
+template <typename URBG>
+struct DistributionCaller;
+class MockHelpers;
+} // namespace random_internal
+} // namespace absl
+
namespace fuzztest {

/// FuzzingBitGen is a BitGen instance which uses the Abseil mock mechanisms
1 change: 1 addition & 0 deletions registry/bazel_registry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
46 changes: 46 additions & 0 deletions registry/modules/abseil-cpp/20260526.0/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2024 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# https://bazel.build/external/overview#bzlmod

module(
name = "abseil-cpp",
version = "20260526.0",
# compatibility_level = 1 is required for interop with other modules that
# depend on earlier abseil-cpp versions. The BCR entry for 20260526.0
# accidentally omits this field (defaulting to 0), causing a conflict.
compatibility_level = 1,
)

cc_configure = use_extension("@rules_cc//cc:extensions.bzl",
"cc_configure_extension",
dev_dependency = True)
use_repo(cc_configure, "local_config_cc")

bazel_dep(name = "rules_cc", version = "0.2.18")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "platforms", version = "1.1.0")

bazel_dep(
name = "google_benchmark",
version = "1.9.5",
dev_dependency = True,
)

# Note: Googletest is NOT a dev_dependency. Some Abseil test utilities
# intended to be used by Abseil users depend on GoogleTest.
bazel_dep(
name = "googletest",
version = "1.17.0.bcr.2",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
diff --git absl/utility/BUILD.bazel absl/utility/BUILD.bazel
--- absl/utility/BUILD.bazel
+++ absl/utility/BUILD.bazel
@@ -45,3 +45,16 @@
"//absl/meta:type_traits",
],
)
+
+# Compatibility shim: removed in 20260526.0 but still referenced by protobuf 29.
+cc_library(
+ name = "if_constexpr",
+ hdrs = [
+ "internal/if_constexpr.h",
+ ],
+ copts = ABSL_DEFAULT_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ deps = [
+ "//absl/base:config",
+ ],
+)
diff --git absl/utility/internal/if_constexpr.h absl/utility/internal/if_constexpr.h
new file mode 100644
--- /dev/null
+++ absl/utility/internal/if_constexpr.h
@@ -0,0 +1,53 @@
+// Copyright 2023 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Compatibility shim: this header was present in abseil through 20250512 but
+// removed in 20260526. protobuf 29 still references the if_constexpr target.
+// This header provides IfConstexpr/IfConstexprElse for pre-C++17 code;
+// in C++17+ you can use `if constexpr` directly.
+
+#ifndef ABSL_UTILITY_INTERNAL_IF_CONSTEXPR_H_
+#define ABSL_UTILITY_INTERNAL_IF_CONSTEXPR_H_
+
+#include <tuple>
+#include <utility>
+
+#include "absl/base/config.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+
+namespace utility_internal {
+
+template <bool condition, typename TrueFunc, typename FalseFunc,
+ typename... Args>
+auto IfConstexprElse(TrueFunc&& true_func, FalseFunc&& false_func,
+ Args&&... args) {
+ return std::get<condition>(std::forward_as_tuple(
+ std::forward<FalseFunc>(false_func), std::forward<TrueFunc>(true_func)))(
+ std::forward<Args>(args)...);
+}
+
+template <bool condition, typename Func, typename... Args>
+void IfConstexpr(Func&& func, Args&&... args) {
+ IfConstexprElse<condition>(std::forward<Func>(func), [](auto&&...){},
+ std::forward<Args>(args)...);
+}
+
+} // namespace utility_internal
+
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_UTILITY_INTERNAL_IF_CONSTEXPR_H_
9 changes: 9 additions & 0 deletions registry/modules/abseil-cpp/20260526.0/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"url": "https://github.com/abseil/abseil-cpp/releases/download/20260526.0/abseil-cpp-20260526.0.tar.gz",
"strip_prefix": "abseil-cpp-20260526.0",
"integrity": "sha256-bhruU1RzQUFkv4Pk68QCQN7HGkcB+KZC2QbpW+oa6gw=",
"patch_strip": 0,
"patches": {
"if_constexpr_compat.patch": "sha256-0F/pU9I+SsPUag7fYcoHKod/ZZolm7ahFlZyNbktiMc="
}
}
9 changes: 9 additions & 0 deletions registry/modules/abseil-cpp/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"homepage": "https://abseil.io",
"maintainers": [],
"repository": ["github:abseil/abseil-cpp"],
"versions": [
"20260526.0"
],
"yanked_versions": {}
}
Loading