Skip to content

Commit a147785

Browse files
diegomarquezpjinseopkim0renovate-bot
authored
fix: re-enable WORKSPACE support (#15362)
* feat: update consumer-test to use 3.0.0-rc1 from BCR (#15354) * fix: restore WORKSPACE functionality * fix: various fixes to restore WORKSPACE * chore: remove unused rules_go settings * chore: format workspace files * chore(deps): update grpc to v1.74.1 (#15316) * chore: restore test configuration * chore: add protobuf patch for grpc * chore: (wip) adaptation of protobuf * chore: update grpc patch * chore: try to modify all com_google_protobuf * Revert "chore: try to modify all com_google_protobuf" This reverts commit 93899cf. * chore: include protobuf with default name * chore: prepare for checkers-pr * chore: restore example * fix: use repo_name for protobuf * chore: cleanup of workspace rules * chore(format): prepare for checkers-pr * chore: remove unintentional line * chore: format comment * fix: reference protobuf binary in testing_util * chore: final adjustments * chore: use protobuf repo instead of unknown third_party library * chore: adapt to checkers * chore: run generator * chore: more checkers adjustments * chore: revert md changes * docs: explain reason for com_google_protobuf * chore: update packaging.md grpc versions --------- Co-authored-by: Jin Seop Kim <[email protected]> Co-authored-by: Mend Renovate <[email protected]>
1 parent 190b2bc commit a147785

File tree

24 files changed

+226
-67
lines changed

24 files changed

+226
-67
lines changed

MODULE.bazel

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ bazel_dep(name = "platforms", version = "1.0.0")
2424
bazel_dep(name = "bazel_skylib", version = "1.8.1")
2525
bazel_dep(name = "rules_cc", version = "0.1.4")
2626
bazel_dep(name = "abseil-cpp", version = "20250127.1")
27-
bazel_dep(name = "protobuf", version = "31.1")
27+
28+
# For backwards compatibility with WORKSPACE.
29+
# The name "com_google_protobuf" is internally used by @bazel_tools,
30+
# a native repository we cannot override.
31+
# See https://github.com/googleapis/google-cloud-cpp/issues/15393
32+
bazel_dep(name = "protobuf", version = "31.1", repo_name = "com_google_protobuf")
2833
bazel_dep(name = "boringssl", version = "0.0.0-20230215-5c22014")
2934
bazel_dep(name = "nlohmann_json", version = "3.11.3")
3035
bazel_dep(name = "curl", version = "8.8.0.bcr.3")

bazel/remove_upb_c_rules.patch

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
diff --git google/api/expr/v1alpha1/BUILD.bazel google/api/expr/v1alpha1/BUILD.bazel
2+
index 9bed46809..197e5249c 100644
3+
--- google/api/expr/v1alpha1/BUILD.bazel
4+
+++ google/api/expr/v1alpha1/BUILD.bazel
5+
@@ -233,32 +233,32 @@ cc_proto_library(
6+
##############################################################################
7+
# upb
8+
##############################################################################
9+
-load(
10+
- "@com_google_googleapis_imports//:imports.bzl",
11+
- "upb_c_proto_library",
12+
-)
13+
-
14+
-upb_c_proto_library(
15+
- name = "checked_upb_proto",
16+
- deps = [":checked_proto"],
17+
-)
18+
-
19+
-upb_c_proto_library(
20+
- name = "eval_upb_proto",
21+
- deps = [":eval_proto"],
22+
-)
23+
-
24+
-upb_c_proto_library(
25+
- name = "explain_upb_proto",
26+
- deps = [":explain_proto"],
27+
-)
28+
-
29+
-upb_c_proto_library(
30+
- name = "syntax_upb_proto",
31+
- deps = [":syntax_proto"],
32+
-)
33+
-
34+
-upb_c_proto_library(
35+
- name = "value_upb_proto",
36+
- deps = [":value_proto"],
37+
-)
38+
+#load(
39+
+ #"@com_google_googleapis_imports//:imports.bzl",
40+
+ #"upb_c_proto_library",
41+
+#)
42+
+#
43+
+#upb_c_proto_library(
44+
+ #name = "checked_upb_proto",
45+
+ #deps = [":checked_proto"],
46+
+#)
47+
+#
48+
+#upb_c_proto_library(
49+
+ #name = "eval_upb_proto",
50+
+ #deps = [":eval_proto"],
51+
+#)
52+
+#
53+
+#upb_c_proto_library(
54+
+ #name = "explain_upb_proto",
55+
+ #deps = [":explain_proto"],
56+
+#)
57+
+#
58+
+#upb_c_proto_library(
59+
+ #name = "syntax_upb_proto",
60+
+ #deps = [":syntax_proto"],
61+
+#)
62+
+#
63+
+#upb_c_proto_library(
64+
+ #name = "value_upb_proto",
65+
+ #deps = [":value_proto"],
66+
+#)
67+
diff --git google/rpc/BUILD.bazel google/rpc/BUILD.bazel
68+
index 31fd6457d..c38f00c46 100644
69+
--- google/rpc/BUILD.bazel
70+
+++ google/rpc/BUILD.bazel
71+
@@ -11,7 +11,7 @@ load(
72+
"php_proto_library",
73+
"py_gapic_assembly_pkg",
74+
"py_proto_library",
75+
- "upb_c_proto_library",
76+
+ #"upb_c_proto_library",
77+
)
78+
load("@rules_proto//proto:defs.bzl", "proto_library")
79+
80+
@@ -104,15 +104,15 @@ cc_proto_library(
81+
deps = [":status_proto"],
82+
)
83+
84+
-upb_c_proto_library(
85+
- name = "code_upb_proto",
86+
- deps = [":code_proto"],
87+
-)
88+
+#upb_c_proto_library(
89+
+ #name = "code_upb_proto",
90+
+ #deps = [":code_proto"],
91+
+#)
92+
93+
-upb_c_proto_library(
94+
- name = "status_upb_proto",
95+
- deps = [":status_proto"],
96+
-)
97+
+#upb_c_proto_library(
98+
+ #name = "status_upb_proto",
99+
+ #deps = [":status_proto"],
100+
+#)
101+
102+
py_proto_library(
103+
name = "code_py_proto",
104+
diff --git repository_rules.bzl repository_rules.bzl
105+
index 2f87ad682..2ab3bd054 100644
106+
--- repository_rules.bzl
107+
+++ repository_rules.bzl
108+
@@ -224,11 +224,11 @@ def switched_rules_by_language(
109+
#
110+
# upb
111+
#
112+
- rules["upb_c_proto_library"] = _switch(
113+
- upb,
114+
- "@com_google_protobuf//bazel:upb_c_proto_library.bzl",
115+
- "upb_c_proto_library",
116+
- )
117+
+ #rules["upb_c_proto_library"] = _switch(
118+
+ # upb,
119+
+ # "@com_google_protobuf//bazel:upb_c_proto_library.bzl",
120+
+ # "upb_c_proto_library",
121+
+ #)
122+
123+
#
124+
# PHP

bazel/workspace0.bzl

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def gl_cpp_workspace0(name = None):
8484
"https://github.com/bufbuild/protoc-gen-validate/archive/v1.2.1.tar.gz",
8585
],
8686
strip_prefix = "protoc-gen-validate-1.2.1",
87+
integrity = "sha256-5HGDUnVN8Tk7h5K2MTOKqFYvOQ6BYHg+NlRUvBHZYyg=",
8788
)
8889

8990
# protobuf requires this
@@ -122,7 +123,7 @@ def gl_cpp_workspace0(name = None):
122123
# //:.*mocks targets, which are public.
123124
maybe(
124125
http_archive,
125-
name = "com_google_googletest",
126+
name = "googletest",
126127
urls = [
127128
"https://github.com/google/googletest/archive/v1.16.0.tar.gz",
128129
],
@@ -141,16 +142,31 @@ def gl_cpp_workspace0(name = None):
141142
strip_prefix = "googleapis-f6801ce4e1df0541abb8d1e996cb36363c41fb8d",
142143
build_file = Label("//bazel:googleapis.BUILD"),
143144
# Scaffolding for patching googleapis after download. For example:
144-
# patches = ["googleapis.patch"]
145-
# NOTE: This should only be used while developing with a new
146-
# protobuf message. No changes to `patches` should ever be
147-
# committed to the main branch.
145+
patches = [
146+
147+
# NOTE: This should only be used while developing with a new
148+
# protobuf message. No changes to `patches` should ever be
149+
# committed to the main branch.
150+
#"googleapis.patch",
151+
152+
# Mirrors the patch from the current bazel module
153+
"//bazel:remove_upb_c_rules.patch",
154+
],
148155
patch_tool = "patch",
149-
patch_args = ["-p1", "-l", "-n"],
150-
patches = [],
156+
157+
# Use the following args when developing with a new proto message
158+
# patch_args = ["-p1", "-l", "-n"],
159+
repo_mapping = {
160+
"@com_github_grpc_grpc": "@grpc",
161+
},
151162
)
152163

153164
# Load protobuf.
165+
# The name "com_google_protobuf" is internally used by @bazel_tools,
166+
# a native repository we cannot override.
167+
# We will revert this to @protobuf once @bazel_tools is deprecated
168+
# and libraries have strayed away from it.
169+
# See https://github.com/googleapis/google-cloud-cpp/issues/15393
154170
maybe(
155171
http_archive,
156172
name = "com_google_protobuf",
@@ -176,30 +192,48 @@ def gl_cpp_workspace0(name = None):
176192
strip_prefix = "boringssl-82a53d8c902f940eb1310f76a0b96c40c67f632f",
177193
)
178194

195+
# This is a transitive dependency of grpc
196+
maybe(
197+
http_archive,
198+
name = "io_bazel_rules_go",
199+
sha256 = "d93ef02f1e72c82d8bb3d5169519b36167b33cf68c252525e3b9d3d5dd143de7",
200+
urls = [
201+
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip",
202+
"https://github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip",
203+
],
204+
patch_args = ["-p1"],
205+
)
206+
179207
# Load gRPC and its dependencies, using a similar pattern to this function.
180208
maybe(
181209
http_archive,
182-
name = "com_github_grpc_grpc",
210+
name = "grpc",
183211
urls = [
184-
"https://github.com/grpc/grpc/archive/v1.71.0.tar.gz",
212+
"https://github.com/grpc/grpc/archive/v1.74.1.tar.gz",
185213
],
186214
repo_mapping = {
187215
"@com_google_absl": "@abseil-cpp",
216+
"@com_github_grpc_grpc": "@grpc",
188217
},
189-
sha256 = "0d631419e54ec5b29def798623ee3bf5520dac77abeab3284ef7027ec2363f91",
190-
strip_prefix = "grpc-1.71.0",
218+
sha256 = "7bf97c11cf3808d650a3a025bbf9c5f922c844a590826285067765dfd055d228",
219+
strip_prefix = "grpc-1.74.1",
220+
)
221+
222+
native.bind(
223+
name = "protocol_compiler",
224+
actual = "@com_google_protobuf//:protoc",
191225
)
192226

193227
# We use the cc_proto_library() rule from @com_google_protobuf, which
194228
# assumes that grpc_cpp_plugin and grpc_lib are in the //external: module
195229
native.bind(
196230
name = "grpc_cpp_plugin",
197-
actual = "@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin",
231+
actual = "@grpc//src/compiler:grpc_cpp_plugin",
198232
)
199233

200234
native.bind(
201235
name = "grpc_lib",
202-
actual = "@com_github_grpc_grpc//:grpc++",
236+
actual = "@grpc//:grpc++",
203237
)
204238

205239
# We need libcurl for the Google Cloud Storage client.
@@ -217,7 +251,7 @@ def gl_cpp_workspace0(name = None):
217251
# We need the nlohmann_json library
218252
maybe(
219253
http_archive,
220-
name = "com_github_nlohmann_json",
254+
name = "nlohmann_json",
221255
urls = [
222256
"https://github.com/nlohmann/json/archive/v3.11.3.tar.gz",
223257
],
@@ -228,7 +262,7 @@ def gl_cpp_workspace0(name = None):
228262
# Load google/crc32c, a library to efficiently compute CRC32C checksums.
229263
maybe(
230264
http_archive,
231-
name = "com_github_google_crc32c",
265+
name = "crc32c",
232266
urls = [
233267
"https://github.com/google/crc32c/archive/1.1.2.tar.gz",
234268
],
@@ -243,7 +277,7 @@ def gl_cpp_workspace0(name = None):
243277
# Open Telemetry
244278
maybe(
245279
http_archive,
246-
name = "io_opentelemetry_cpp",
280+
name = "opentelemetry-cpp",
247281
urls = [
248282
"https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz",
249283
],

bazel/workspace2.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
"""Load dependencies needed for google-cloud-cpp development / Phase 2."""
1616

1717
load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies")
18-
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
1918
load(
2019
"@googleapis//:repository_rules.bzl",
2120
"switched_rules_by_language",
2221
)
22+
load("@grpc//bazel:grpc_deps.bzl", "grpc_deps")
2323
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies")
2424

2525
def gl_cpp_workspace2(name = None):

bazel/workspace3.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
"""Load dependencies needed for google-cloud-cpp development / Phase 3."""
1616

17-
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
18-
load("@com_google_googletest//:googletest_deps.bzl", "googletest_deps")
1917
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
20-
load("@io_opentelemetry_cpp//bazel:repository.bzl", "opentelemetry_cpp_deps")
18+
load("@googletest//:googletest_deps.bzl", "googletest_deps")
19+
load("@grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
20+
load("@opentelemetry-cpp//bazel:repository.bzl", "opentelemetry_cpp_deps")
2121

2222
def gl_cpp_workspace3(name = None):
2323
"""Loads dependencies needed to use the google-cloud-cpp libraries.
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
module(name = "bzlmod-consumer-test")
22

3-
bazel_dep(name = "google_cloud_cpp", version = "3.0.0-rc0")
3+
bazel_dep(name = "google_cloud_cpp", version = "3.0.0-rc1")
44
bazel_dep(name = "googletest", version = "1.15.2")
55
bazel_dep(name = "rules_cc", version = "0.1.1")
6-
7-
local_path_override(
8-
module_name = "google_cloud_cpp",
9-
path = "/workspace/google-cloud-cpp",
10-
)

ci/cloudbuild/dockerfiles/demo-debian-bullseye.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ RUN curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \
127127

128128
# ```bash
129129
WORKDIR /var/tmp/build/grpc
130-
RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.0.tar.gz | \
130+
RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.74.1.tar.gz | \
131131
tar -xzf - --strip-components=1 && \
132132
cmake \
133133
-DCMAKE_BUILD_TYPE=Release \

ci/cloudbuild/dockerfiles/demo-rockylinux-9.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ RUN curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \
130130

131131
# ```bash
132132
WORKDIR /var/tmp/build/grpc
133-
RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.0.tar.gz | \
133+
RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.74.1.tar.gz | \
134134
tar -xzf - --strip-components=1 && \
135135
cmake \
136136
-DCMAKE_CXX_STANDARD=17 \

ci/cloudbuild/dockerfiles/demo-ubuntu-focal.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ RUN curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \
9797

9898
# ```bash
9999
WORKDIR /var/tmp/build/grpc
100-
RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.0.tar.gz | \
100+
RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.74.1.tar.gz | \
101101
tar -xzf - --strip-components=1 && \
102102
cmake \
103103
-DCMAKE_BUILD_TYPE=Release \

ci/cloudbuild/dockerfiles/demo-ubuntu-jammy.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v31.1.tar.gz
7878

7979
# ```bash
8080
WORKDIR /var/tmp/build/grpc
81-
RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.0.tar.gz | \
81+
RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.74.1.tar.gz | \
8282
tar -xzf - --strip-components=1 && \
8383
cmake \
8484
-DCMAKE_BUILD_TYPE=Release \

0 commit comments

Comments
 (0)