Skip to content

Commit 41345c8

Browse files
committed
Upgrade absl, protobuf and grpc
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 3e39b30 commit 41345c8

9 files changed

Lines changed: 48 additions & 89 deletions

bazel/external/grpc_go_toolchain.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ diff --git a/bazel/grpc_extra_deps.bzl b/bazel/grpc_extra_deps.bzl
22
index 4d8afa3131..514189f9a5 100644
33
--- a/bazel/grpc_extra_deps.bzl
44
+++ b/bazel/grpc_extra_deps.bzl
5-
@@ -53,7 +53,7 @@ def grpc_extra_deps(ignore_version_differences = False):
5+
@@ -63,7 +63,7 @@ def grpc_extra_deps(ignore_version_differences = False):
66
api_dependencies()
7-
7+
88
go_rules_dependencies()
9-
- go_register_toolchains(version = "1.18")
9+
- go_register_toolchains(version = "1.22.5")
1010
+ go_register_toolchains()
1111
gazelle_dependencies()
12-
12+
1313
# Pull-in the go 3rd party dependencies for protoc_gen_validate, which is

bazel/external/grpc_test_visibility.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.

bazel/external/protobuf_text_format.patch

Lines changed: 21 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,13 @@
1-
diff --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc
2-
index 594c8eac6..c7ef9437b 100644
3-
--- a/src/google/protobuf/stubs/strutil.cc
4-
+++ b/src/google/protobuf/stubs/strutil.cc
5-
@@ -592,7 +592,7 @@ void CEscapeAndAppend(StringPiece src, std::string *dest) {
6-
}
7-
}
8-
9-
-std::string CEscape(const std::string &src) {
10-
+std::string CEscape(StringPiece src) {
11-
std::string dest;
12-
CEscapeAndAppend(src, &dest);
13-
return dest;
14-
diff --git a/src/google/protobuf/stubs/strutil.h b/src/google/protobuf/stubs/strutil.h
15-
index 9658abf90..9cf9cae83 100644
16-
--- a/src/google/protobuf/stubs/strutil.h
17-
+++ b/src/google/protobuf/stubs/strutil.h
18-
@@ -328,7 +328,7 @@ PROTOBUF_EXPORT std::string UnescapeCEscapeString(const std::string& src);
19-
//
20-
// Escaped chars: \n, \r, \t, ", ', \, and !isprint().
21-
// ----------------------------------------------------------------------
22-
-PROTOBUF_EXPORT std::string CEscape(const std::string& src);
23-
+PROTOBUF_EXPORT std::string CEscape(StringPiece src);
24-
25-
// ----------------------------------------------------------------------
26-
// CEscapeAndAppend()
271
diff --git a/src/google/protobuf/text_format.cc b/src/google/protobuf/text_format.cc
28-
index 19110499d..0d116ee7e 100644
2+
index 2c0a95d..1234567 100644
293
--- a/src/google/protobuf/text_format.cc
304
+++ b/src/google/protobuf/text_format.cc
31-
@@ -81,6 +81,18 @@ inline bool IsOctNumber(const std::string& str) {
5+
@@ -82,6 +82,18 @@ inline bool IsOctNumber(const std::string& str) {
326
(str[1] >= '0' && str[1] < '8'));
337
}
34-
35-
+// Returns true if truncatation occurred.
36-
+bool TruncateString(int64_t max_length, StringPiece* s) {
8+
9+
+// Returns true if truncation occurred.
10+
+bool TruncateString(int64_t max_length, absl::string_view* s) {
3711
+ if (max_length > 0) {
3812
+ int64_t excess = static_cast<int64_t>(s->size()) - max_length;
3913
+ if (excess > 0) {
@@ -44,10 +18,10 @@ index 19110499d..0d116ee7e 100644
4418
+ return false;
4519
+}
4620
+
47-
} // namespace
48-
49-
namespace internal {
50-
@@ -2555,20 +2567,22 @@ void TextFormat::Printer::PrintFieldValue(const Message& message,
21+
// The number of fields that are redacted in AbslStringify.
22+
std::atomic<int64_t> num_redacted_field{0};
23+
24+
@@ -2738,20 +2750,22 @@ void TextFormat::Printer::PrintFieldValue(const Message& message,
5125
? reflection->GetRepeatedStringReference(message, field, index,
5226
&scratch)
5327
: reflection->GetStringReference(message, field, &scratch);
@@ -60,39 +34,39 @@ index 19110499d..0d116ee7e 100644
6034
- "...<truncated>...";
6135
- value_to_print = &truncated_value;
6236
- }
63-
+ StringPiece value_to_print(value);
37+
+ absl::string_view value_to_print(value);
6438
+ bool truncated = TruncateString(truncate_string_field_longer_than_, &value_to_print);
6539
+
6640
if (field->type() == FieldDescriptor::TYPE_STRING) {
6741
- printer->PrintString(*value_to_print, generator);
6842
+ if (truncated) {
69-
+ printer->PrintString(StrCat(value_to_print, "...<truncated>..."), generator);
43+
+ printer->PrintString(absl::StrCat(value_to_print, "...<truncated>..."), generator);
7044
+ } else {
7145
+ printer->PrintString(value, generator);
7246
+ }
7347
} else {
74-
GOOGLE_DCHECK_EQ(field->type(), FieldDescriptor::TYPE_BYTES);
48+
ABSL_DCHECK_EQ(field->type(), FieldDescriptor::TYPE_BYTES);
7549
- printer->PrintBytes(*value_to_print, generator);
7650
+ if (truncated) {
77-
+ printer->PrintBytes(StrCat(value_to_print, "...<truncated>..."), generator);
51+
+ printer->PrintBytes(absl::StrCat(value_to_print, "...<truncated>..."), generator);
7852
+ } else {
7953
+ printer->PrintBytes(value, generator);
8054
+ }
8155
}
8256
break;
8357
}
84-
@@ -2708,7 +2722,14 @@ void TextFormat::Printer::PrintUnknownFields(
85-
// This field is not parseable as a Message (or we ran out of
86-
// recursion budget). So it is probably just a plain string.
87-
generator->PrintMaybeWithMarker(": ", "\"");
88-
- generator->PrintString(CEscape(value));
89-
+ StringPiece value_to_print(value);
58+
@@ -2937,7 +2951,14 @@ void TextFormat::Printer::PrintUnknownFields(
59+
break;
60+
}
61+
generator->PrintMaybeWithMarker(MarkerToken(), ": ", "\"");
62+
- generator->PrintString(absl::CEscape(value));
63+
+ absl::string_view value_to_print(value);
9064
+ bool truncated = TruncateString(truncate_string_field_longer_than_, &value_to_print);
9165
+
9266
+ if (truncated) {
93-
+ generator->PrintString(CEscape(value_to_print) + "...<truncated>...");
67+
+ generator->PrintString(absl::StrCat(absl::CEscape(value_to_print), "...<truncated>..."));
9468
+ } else {
95-
+ generator->PrintString(CEscape(value));
69+
+ generator->PrintString(absl::CEscape(value));
9670
+ }
9771
if (single_line_mode_) {
9872
generator->PrintLiteral("\" ");

bazel/external/protobuf_warning.patch

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ index 5e9a2c418..f95684bd1 100644
1414
virtual_path = "";
1515
disk_path = parts[i];
1616
diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc
17-
index 5f3427dc7..ab049c7c6 100644
17+
index 7456d3c3d..ddcd08c17 100644
1818
--- a/src/google/protobuf/descriptor.cc
1919
+++ b/src/google/protobuf/descriptor.cc
20-
@@ -8161,10 +8161,11 @@ void DescriptorBuilder::LogUnusedDependency(const FileDescriptorProto& proto,
20+
@@ -10410,10 +10410,11 @@ void DescriptorBuilder::LogUnusedDependency(const FileDescriptorProto& proto,
2121
if (is_error) {
22-
AddError((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
23-
error_message);
22+
AddError(unused->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
23+
make_error);
2424
- } else {
25-
- AddWarning((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
26-
- error_message);
25+
- AddWarning(unused->name(), proto,
26+
- DescriptorPool::ErrorCollector::IMPORT, make_error);
2727
}
2828
+ // else {
29-
+ // AddWarning((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
30-
+ // error_message);
29+
+ // AddWarning(unused->name(), proto,
30+
+ // DescriptorPool::ErrorCollector::IMPORT, make_error);
3131
+ // }
3232
}
3333
}

bazel/grpc_web.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pl_grpc_web_library = rule(
184184
default = Label("@com_google_protobuf//:well_known_protos"),
185185
),
186186
"_protoc": attr.label(
187-
default = Label("//external:protocol_compiler"),
187+
default = Label("@com_google_protobuf//:protoc"),
188188
executable = True,
189189
cfg = "host",
190190
),

bazel/proto_compile.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def pl_cc_proto_library(name, proto, deps = [], **kwargs):
8585
)
8686
grpc_deps = [
8787
"@com_github_grpc_grpc//:grpc++_codegen_proto",
88-
"//external:protobuf",
88+
"@com_google_protobuf//:protoc",
8989
]
9090
pl_cc_library_internal(
9191
name = name,

bazel/repositories.bzl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,12 @@ def _cc_deps():
122122

123123
_bazel_repo("rules_cc")
124124
_bazel_repo("upb")
125-
_bazel_repo("com_google_protobuf", patches = ["//bazel/external:protobuf_text_format.patch", "//bazel/external:protobuf_warning.patch"], patch_args = ["-p1"])
126-
_bazel_repo("com_github_grpc_grpc", patches = ["//bazel/external:grpc.patch", "//bazel/external:grpc_go_toolchain.patch", "//bazel/external:grpc_test_visibility.patch"], patch_args = ["-p1"])
125+
_bazel_repo("com_google_protobuf", patches = ["//bazel/external:protobuf_text_format.patch", "//bazel/external:protobuf_warning.patch"], patch_args = ["-p1"], repo_mapping = {"@abseil-cpp": "@com_google_absl"})
126+
_bazel_repo("com_github_grpc_grpc", patches = ["//bazel/external:grpc.patch", "//bazel/external:grpc_go_toolchain.patch"], patch_args = ["-p1"])
127127

128128
_bazel_repo("boringssl", patches = ["//bazel/external:boringssl.patch"], patch_args = ["-p0"])
129129
_bazel_repo("com_google_benchmark")
130-
_bazel_repo("com_google_googletest")
131-
# _bazel_repo("com_google_googletest", repo_mapping = {"@abseil-cpp": "@com_google_absl"})
130+
_bazel_repo("com_google_googletest", repo_mapping = {"@abseil-cpp": "@com_google_absl"})
132131
_bazel_repo("com_github_gflags_gflags")
133132
_bazel_repo("com_github_google_glog")
134133
_bazel_repo("com_google_absl")

bazel/repository_locations.bzl

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ REPOSITORY_LOCATIONS = dict(
106106
urls = ["https://github.com/gperftools/gperftools/releases/download/gperftools-2.9.1/gperftools-2.9.1.tar.gz"],
107107
),
108108
com_github_grpc_grpc = dict(
109-
sha256 = "b55696fb249669744de3e71acc54a9382bea0dce7cd5ba379b356b12b82d4229",
110-
strip_prefix = "grpc-1.51.1",
111-
urls = ["https://github.com/grpc/grpc/archive/refs/tags/v1.51.1.tar.gz"],
109+
sha256 = "7bf97c11cf3808d650a3a025bbf9c5f922c844a590826285067765dfd055d228",
110+
strip_prefix = "grpc-1.74.1",
111+
urls = ["https://github.com/grpc/grpc/archive/refs/tags/v1.74.1.tar.gz"],
112112
),
113113
# August 19, 2020.
114114
com_github_google_sentencepiece = dict(
@@ -232,9 +232,9 @@ REPOSITORY_LOCATIONS = dict(
232232
urls = ["https://github.com/pixie-io/libpypa/archive/eba8ec485a6c5e566d0d7a0716a06c91837c9d2f.tar.gz"],
233233
),
234234
com_google_absl = dict(
235-
sha256 = "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8",
236-
strip_prefix = "abseil-cpp-20220623.1",
237-
urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20220623.1.tar.gz"],
235+
sha256 = "9b7a064305e9fd94d124ffa6cc358592eb42b5da588fb4e07d09254aa40086db",
236+
strip_prefix = "abseil-cpp-20250512.1",
237+
urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20250512.1.tar.gz"],
238238
),
239239
com_google_benchmark = dict(
240240
sha256 = "d26789a2b46d8808a48a4556ee58ccc7c497fcd4c0af9b90197674a81e04798a",
@@ -262,11 +262,10 @@ REPOSITORY_LOCATIONS = dict(
262262
urls = ["https://github.com/google/googletest/archive/refs/tags/v1.17.0.tar.gz"],
263263
),
264264
com_google_protobuf = dict(
265-
sha256 = "63c5539a8506dc6bccd352a857cea106e0a389ce047a3ff0a78fe3f8fede410d",
266-
strip_prefix = "protobuf-24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb",
265+
sha256 = "07a43d88fe5a38e434c7f94129cad56a4c43a51f99336074d0799c2f7d4e44c5",
266+
strip_prefix = "protobuf-30.2",
267267
urls = [
268-
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/protobuf/archive/24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb.tar.gz",
269-
"https://github.com/protocolbuffers/protobuf/archive/24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb.tar.gz",
268+
"https://github.com/protocolbuffers/protobuf/archive/v30.2.tar.gz",
270269
],
271270
),
272271
com_google_protobuf_javascript = dict(

src/carnot/exec/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ pl_cc_test(
259259
":cc_library",
260260
":test_utils",
261261
"//src/carnot/planpb:plan_testutils",
262-
"@com_github_grpc_grpc//test/core/util:grpc_test_util_base",
262+
"@com_github_grpc_grpc//test/core/test_util:grpc_test_util_base",
263263
],
264264
)
265265

0 commit comments

Comments
 (0)