Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: Bump com_google_protobuf -> 24.1 #29238

Closed
wants to merge 1 commit into from
Closed
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
15 changes: 15 additions & 0 deletions bazel/proto_converter.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/src/google/protobuf/util/converter/port_def.inc b/src/google/protobuf/util/converter/port_def.inc
index 41af5b7..28ad7af 100644
--- a/src/google/protobuf/util/converter/port_def.inc
+++ b/src/google/protobuf/util/converter/port_def.inc
@@ -413,10 +413,6 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
#define PROTOBUF_ATTRIBUTE_REINITIALIZES
#endif

-// The minimum library version which works with the current version of the
-// headers.
-#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 4023000
-
#ifdef PROTOBUF_RTTI
#error PROTOBUF_RTTI was previously defined
#endif
81 changes: 34 additions & 47 deletions bazel/protobuf.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/BUILD.bazel b/BUILD.bazel
index 0f6e41e3a..c0d2bbccf 100644
index a5fa012e1..8dcc2924f 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -454,14 +454,79 @@ cc_library(
@@ -171,14 +171,79 @@ alias(
visibility = ["//visibility:public"],
)

Expand Down Expand Up @@ -84,24 +84,38 @@ index 0f6e41e3a..c0d2bbccf 100644
name = "protoc_static",
copts = COPTS,
diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py
index e7555ee10..a93beb1c5 100644
index 4832625e9..7de598572 100755
--- a/python/google/protobuf/__init__.py
+++ b/python/google/protobuf/__init__.py
@@ -31,3 +31,10 @@
# Copyright 2007 Google Inc. All Rights Reserved.

__version__ = '4.23.4'
__version__ = '4.24.1'
+
+
+if __name__ != '__main__':
+ try:
+ __import__('pkg_resources').declare_namespace(__name__)
+ except ImportError:
+ __path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel
index 9b4c243d1..56067f36e 100644
--- a/src/google/protobuf/compiler/BUILD.bazel
+++ b/src/google/protobuf/compiler/BUILD.bazel
@@ -377,7 +377,7 @@ cc_library(
srcs = ["retention.cc"],
hdrs = ["retention.h"],
include_prefix = "google/protobuf/compiler",
- visibility = ["//src/google/protobuf:__subpackages__"],
+ visibility = ["//visibility:public"],
deps = [
"//src/google/protobuf:protobuf_nowkt",
"@com_google_absl//absl/container:flat_hash_set",
diff --git a/src/google/protobuf/io/BUILD.bazel b/src/google/protobuf/io/BUILD.bazel
index 5888a900b..2391a1cb7 100644
--- a/src/google/protobuf/io/BUILD.bazel
+++ b/src/google/protobuf/io/BUILD.bazel
@@ -138,7 +138,7 @@ cc_library(
@@ -142,7 +142,7 @@ cc_library(
"@com_google_absl//absl/log:absl_log",
] + select({
"//build_defs:config_msvc": [],
Expand All @@ -110,34 +124,11 @@ diff --git a/src/google/protobuf/io/BUILD.bazel b/src/google/protobuf/io/BUILD.b
}),
)

diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
--- a/src/google/protobuf/port_def.inc 2023-06-27 01:17:34.917105764 +0000
+++ b/src/google/protobuf/port_def.inc 2023-06-27 01:18:12.069060142 +0000
@@ -1004,7 +1004,7 @@
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
// Turn on -Wdeprecated-enum-enum-conversion. This deprecation comes in C++20
// via http://wg21.link/p1120r0.
-#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
+// #pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
// This error has been generally flaky, but we need to disable it specifically
// to fix https://github.com/protocolbuffers/protobuf/issues/12313
#pragma clang diagnostic ignored "-Wunused-parameter"
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h
--- a/src/google/protobuf/map.h 2023-06-30 14:32:34.892148233 +0000
+++ b/src/google/protobuf/map.h 2023-06-30 14:35:37.447992493 +0000
@@ -883,7 +883,7 @@
TreeConvert(b);
}
ABSL_DCHECK(TableEntryIsTree(b))
- << (void*)table_[b] << " " << (uintptr_t)table_[b];
+ << reinterpret_cast<void*>(table_[b]) << " " << static_cast<uintptr_t>(table_[b]);
InsertUniqueInTree(b, node);
index_of_first_non_null_ = (std::min)(index_of_first_non_null_, b);
}
diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h
--- a/src/google/protobuf/map_field.h 2023-06-30 17:14:18.934528580 +0000
+++ b/src/google/protobuf/map_field.h 2023-06-30 17:14:52.098500807 +0000
@@ -345,7 +345,7 @@
index 308e9ac07..08e734a6d 100644
--- a/src/google/protobuf/map_field.h
+++ b/src/google/protobuf/map_field.h
@@ -324,7 +324,7 @@ class PROTOBUF_EXPORT MapFieldBase : public MapFieldBaseForParse {

protected:
// "protected" stops users from deleting a `MapFieldBase *`
Expand All @@ -146,24 +137,20 @@ diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h

public:
// Returns reference to internal repeated field. Data written using
diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel
--- a/src/google/protobuf/compiler/BUILD.bazel
+++ b/src/google/protobuf/compiler/BUILD.bazel
@@ -306,7 +306,7 @@
srcs = ["retention.cc"],
hdrs = ["retention.h"],
include_prefix = "google/protobuf/compiler",
- visibility = ["//src/google/protobuf:__subpackages__"],
+ visibility = ["//visibility:public"],
deps = [
"//src/google/protobuf:protobuf_nowkt",
"@com_google_absl//absl/types:span",

diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
index 1c6a24945..c27d0bf2a 100644
index e4f5a0692..2caae538a 100644
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -1062,6 +1062,9 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
@@ -1038,7 +1038,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
// Turn on -Wdeprecated-enum-enum-conversion. This deprecation comes in C++20
// via http://wg21.link/p1120r0.
-#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
+// #pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
// This error has been generally flaky, but we need to disable it specifically
// to fix https://github.com/protocolbuffers/protobuf/issues/12313
#pragma clang diagnostic ignored "-Wunused-parameter"
@@ -1104,6 +1104,9 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
#pragma warning(disable: 4125)
#endif

Expand Down
6 changes: 5 additions & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ def envoy_repo():
# Bazel native C++ dependencies. For the dependencies that doesn't provide autoconf/automake builds.
def _cc_deps():
external_http_archive("grpc_httpjson_transcoding")
external_http_archive("com_google_protoconverter")
external_http_archive(
"com_google_protoconverter",
patch_args = ["-p1"],
patches = ["@envoy//bazel:proto_converter.patch"],
)
external_http_archive("com_google_protofieldextraction")
external_http_archive("ocp")
native.bind(
Expand Down
18 changes: 9 additions & 9 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# This should match the schema defined in external_deps.bzl.

PROTOBUF_VERSION = "23.4"
PROTOBUF_VERSION = "24.1"

# These names of these deps *must* match the names used in `/bazel/protobuf.patch`,
# and both must match the names from the protobuf releases (see
# https://github.com/protocolbuffers/protobuf/releases).
# The names change in upcoming versions.
# The shas are calculated from the downloads on the releases page.
PROTOC_VERSIONS = dict(
linux_aarch_64 = "1c7750b6e038305b5a7fc3d0cda1ebefdf106a4f30a787bf826ed2fc47c3967d",
linux_x86_64 = "0502f286ac9ed860b629a7965a14527b1f2dd131e4283fa23c2d7f184672aa9a",
osx_aarch_64 = "8c7afae8626b6811e7b5897d16d940c2dbf50b1e135ed958a01db6566bdda726",
osx_x86_64 = "07e5fdcf1b0708d3367dc5e6eb8d135de7e407d75316c93155cfd8ab362eec80",
win64 = "a309c39442fb75f0db343cb22c111a00f91cdf0767f332e170644b9378e2bcc6",
linux_aarch_64 = "676a38ff5584c913bbab3991bb1a515b8cbd22a12c029e24c440d9b05c816f1c",
linux_x86_64 = "1b9d1467205530986d58d24d2b89b9db3c8a9e3c31ed40b2a223913480ca8987",
osx_aarch_64 = "e7c622512ad2133f25bc6369e1330809daa7ae2742611bf596bbc904e18ca8d5",
osx_x86_64 = "476782d4220ff7b2d8b333a648a1f8a52c200211db85e76347e668d9d4c07515",
win64 = "dad1efed75cb772a0c9e5d4646006bf87e1e051191473a2a30c9db66ee223cfd",
)

REPOSITORY_LOCATIONS_SPEC = dict(
Expand Down Expand Up @@ -825,11 +825,11 @@ REPOSITORY_LOCATIONS_SPEC = dict(
# test/common/json:gen_excluded_unicodes to recompute the ranges
# excluded from differential fuzzing that are populated in
# test/common/json/json_sanitizer_test_util.cc.
sha256 = "a700a49470d301f1190a487a923b5095bf60f08f4ae4cac9f5f7c36883d17971",
sha256 = "0930b1a6eb840a2295dfcb13bb5736d1292c3e0d61a90391181399327be7d8f1",
strip_prefix = "protobuf-{version}",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v{version}/protobuf-{version}.tar.gz"],
use_category = ["dataplane_core", "controlplane"],
release_date = "2023-07-06",
release_date = "2023-08-18",
cpe = "cpe:2.3:a:google:protobuf:*",
license = "Protocol Buffers",
license_url = "https://github.com/protocolbuffers/protobuf/blob/v{version}/LICENSE",
Expand Down Expand Up @@ -1463,7 +1463,7 @@ def _compiled_protoc_deps(locations, versions):
sha256 = sha,
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v{version}/protoc-{version}-%s.zip" % platform.replace("_", "-", 1)],
use_category = ["dataplane_core", "controlplane"],
release_date = "2023-07-06",
release_date = "2023-08-18",
cpe = "N/A",
license = "Protocol Buffers",
license_url = "https://github.com/protocolbuffers/protobuf/blob/v{version}/LICENSE",
Expand Down