Skip to content

Commit 87125ff

Browse files
authored
Remove references to go_googleapis (#3603)
1 parent 6b3d718 commit 87125ff

File tree

12 files changed

+47
-154801
lines changed

12 files changed

+47
-154801
lines changed

.bazelci/presubmit.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -118,32 +118,13 @@ tasks:
118118
- "-@com_google_protobuf//:timestamp_proto"
119119
- "-@com_google_protobuf//:type_proto"
120120
- "-@com_google_protobuf//:wrappers_proto"
121-
- "-@go_googleapis//google/rpc:code_go_proto"
122-
- "-@go_googleapis//google/rpc:code_proto"
123-
- "-@go_googleapis//google/rpc:errdetails_go_proto"
124-
- "-@go_googleapis//google/rpc:errdetails_proto"
125-
- "-@go_googleapis//google/rpc:status_go_proto"
126-
- "-@go_googleapis//google/rpc:status_proto"
127-
- "-@go_googleapis//google/type:color_go_proto"
128121
- "-@gogo_special_proto//github.com/gogo/protobuf/gogoproto:gogoproto"
129122
- "-//go/tools/bazel:bazel_test"
130123
- "-@io_bazel_rules_go//proto:gogofaster_proto"
131124
- "-@io_bazel_rules_go//proto:go_grpc"
132125
- "-@io_bazel_rules_go//proto:go_proto"
133126
- "-@io_bazel_rules_go//proto:go_proto_bootstrap"
134127
- "-@io_bazel_rules_go//proto:go_proto_validate"
135-
- "-@io_bazel_rules_go//proto/wkt:any_go_proto"
136-
- "-@io_bazel_rules_go//proto/wkt:api_go_proto"
137-
- "-@io_bazel_rules_go//proto/wkt:compiler_plugin_go_proto"
138-
- "-@io_bazel_rules_go//proto/wkt:descriptor_go_proto"
139-
- "-@io_bazel_rules_go//proto/wkt:duration_go_proto"
140-
- "-@io_bazel_rules_go//proto/wkt:empty_go_proto"
141-
- "-@io_bazel_rules_go//proto/wkt:field_mask_go_proto"
142-
- "-@io_bazel_rules_go//proto/wkt:source_context_go_proto"
143-
- "-@io_bazel_rules_go//proto/wkt:struct_go_proto"
144-
- "-@io_bazel_rules_go//proto/wkt:timestamp_go_proto"
145-
- "-@io_bazel_rules_go//proto/wkt:type_go_proto"
146-
- "-@io_bazel_rules_go//proto/wkt:wrappers_go_proto"
147128
- "-@org_golang_x_crypto//ed25519:ed25519_test"
148129
- "-@org_golang_x_crypto//sha3:sha3_test"
149130
- "-@org_golang_x_sys//windows/registry:registry_test"

MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ bazel_dep(name = "protobuf", version = "3.19.2", repo_name = "com_google_protobu
1313
non_module_dependencies = use_extension("//go/private:extensions.bzl", "non_module_dependencies")
1414
use_repo(
1515
non_module_dependencies,
16-
"go_googleapis",
1716
"io_bazel_rules_nogo",
1817
)
1918

WORKSPACE

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ bazel_skylib_workspace()
7575

7676
http_archive(
7777
name = "bazel_gazelle",
78-
sha256 = "727f3e4edd96ea20c29e8c2ca9e8d2af724d8c7778e7923a854b2c80952bc405",
78+
sha256 = "178eba9540a616bda314afa25a91f195758a9fed178eda72e149eb0d20e9b670",
79+
strip_prefix = "bazel-gazelle-9fe0a3ff751647789690293dcbb3c87ea33b7566",
7980
urls = [
80-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz",
81-
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz",
81+
"https://github.com/bazelbuild/bazel-gazelle/archive/9fe0a3ff751647789690293dcbb3c87ea33b7566.zip",
8282
],
8383
)
8484

@@ -119,6 +119,25 @@ go_repository(
119119
version = "v0.6.0",
120120
)
121121

122+
http_archive(
123+
name = "googleapis",
124+
sha256 = "9d1a930e767c93c825398b8f8692eca3fe353b9aaadedfbcf1fca2282c85df88",
125+
strip_prefix = "googleapis-64926d52febbf298cb82a8f472ade4a3969ba922",
126+
urls = [
127+
"https://github.com/googleapis/googleapis/archive/64926d52febbf298cb82a8f472ade4a3969ba922.zip",
128+
],
129+
)
130+
131+
go_repository(
132+
name = "org_golang_google_genproto",
133+
build_extra_args = ["-exclude=vendor"],
134+
build_file_generation = "on",
135+
build_file_proto_mode = "disable_global",
136+
importpath = "google.golang.org/genproto",
137+
sum = "h1:S9GbmC1iCgvbLyAokVCwiO6tVIrU9Y7c5oMx1V/ki/Y=",
138+
version = "v0.0.0-20221024183307-1bc688fe9f3e",
139+
)
140+
122141
# TODO(sluongng): Gazelle v0.25.0 switched to static dependency resolution which cause
123142
# build files generation in external dependencies to wrongly resolve these repositories.
124143
# We should investigate in Gazelle why this happen and fix it.
@@ -180,8 +199,13 @@ load(
180199

181200
apple_support_dependencies()
182201

183-
# For testing the compatibility with a hermetic cc toolchain. Users should not have to enable it.
202+
load("@googleapis//:repository_rules.bzl", "switched_rules_by_language")
184203

204+
switched_rules_by_language(
205+
name = "com_google_googleapis_imports",
206+
)
207+
208+
# For testing the compatibility with a hermetic cc toolchain. Users should not have to enable it.
185209
http_archive(
186210
name = "hermetic_cc_toolchain",
187211
sha256 = "bd2234acd0837251361be3270d7d3ce599b418be123d902d84762302e31a3014",

go/dependencies.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Go workspace rules
77
.. _github.com/gogo/protobuf: https://github.com/gogo/protobuf
88
.. _github.com/golang/protobuf: https://github.com/golang/protobuf/
99
.. _github.com/google/protobuf: https://github.com/google/protobuf/
10-
.. _github.com/googleapis/googleapis: https://github.com/googleapis/googleapis
1110
.. _github.com/mwitkow/go-proto-validators: https://github.com/mwitkow/go-proto-validators
1211
.. _golang.org/x/net: https://github.com/golang/net/
1312
.. _golang.org/x/sys: https://github.com/golang/sys/
@@ -107,13 +106,6 @@ It also declares some internal repositories not described here.
107106
| ``go_rules_dependencies`` should provide this, but it doesn't change often, |
108107
| and many things break without it. |
109108
+-------------------------------------------------+-------------------------------------------+
110-
| :value:`go_googleapis` | `github.com/googleapis/googleapis`_ |
111-
+-------------------------------------------------+-------------------------------------------+
112-
| Like :value:`org_golang_google_genproto` but provides ``go_proto_library`` |
113-
| targets instead of ``go_library``. Ideally we should use |
114-
| ``com_google_googleapis``, but Gazelle still resolves imports to this repo. |
115-
| See `#1986`_. |
116-
+-------------------------------------------------+-------------------------------------------+
117109

118110
Proto dependencies
119111
------------------

go/private/repositories.bzl

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ def go_rules_dependencies(force = False):
216216
name = "gogo_special_proto",
217217
)
218218

219-
# go_library targets with pre-generated sources for Well Known Types
220-
# and Google APIs.
219+
# go_library targets with pre-generated sources for Well Known Types.
221220
# Doesn't belong here, but it would be an annoying source of errors if
222221
# this weren't generated with -proto disable_global.
223222
# releaser:upgrade-dep googleapis go-genproto
@@ -238,33 +237,6 @@ def go_rules_dependencies(force = False):
238237
patch_args = ["-p1"],
239238
)
240239

241-
# go_proto_library targets for gRPC and Google APIs.
242-
# TODO(#1986): migrate to com_google_googleapis. This workspace was added
243-
# before the real workspace supported Bazel. Gazelle resolves dependencies
244-
# here. Gazelle should resolve dependencies to com_google_googleapis
245-
# instead, and we should remove this.
246-
# releaser:upgrade-dep googleapis googleapis
247-
wrapper(
248-
http_archive,
249-
name = "go_googleapis",
250-
# master, as of 2022-12-05
251-
urls = [
252-
"https://mirror.bazel.build/github.com/googleapis/googleapis/archive/83c3605afb5a39952bf0a0809875d41cf2a558ca.zip",
253-
"https://github.com/googleapis/googleapis/archive/83c3605afb5a39952bf0a0809875d41cf2a558ca.zip",
254-
],
255-
sha256 = "ba694861340e792fd31cb77274eacaf6e4ca8bda97707898f41d8bebfd8a4984",
256-
strip_prefix = "googleapis-83c3605afb5a39952bf0a0809875d41cf2a558ca",
257-
patches = [
258-
# releaser:patch-cmd find . -name BUILD.bazel -delete
259-
Label("//third_party:go_googleapis-deletebuild.patch"),
260-
# set gazelle directives; change workspace name
261-
Label("//third_party:go_googleapis-directives.patch"),
262-
# releaser:patch-cmd gazelle -repo_root .
263-
Label("//third_party:go_googleapis-gazelle.patch"),
264-
],
265-
patch_args = ["-E", "-p1"],
266-
)
267-
268240
# releaser:upgrade-dep golang mock
269241
_maybe(
270242
http_archive,

tests/bcr/MODULE.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ local_path_override(
1919
)
2020

2121
bazel_dep(name = "gazelle", version = "0.26.0")
22+
archive_override(
23+
module_name = "gazelle",
24+
strip_prefix = "bazel-gazelle-9fe0a3ff751647789690293dcbb3c87ea33b7566",
25+
urls = [
26+
"https://github.com/bazelbuild/bazel-gazelle/archive/9fe0a3ff751647789690293dcbb3c87ea33b7566.zip",
27+
],
28+
)
2229
bazel_dep(name = "protobuf", version = "3.19.6")
2330

2431
go_sdk = use_extension("@my_rules_go//go:extensions.bzl", "go_sdk")

tests/extras/gomock/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ go_library(
88
importpath = "github.com/bazelbuild/rules_go/gomock/client",
99
visibility = ["//visibility:public"],
1010
deps = [
11-
"@go_googleapis//google/bytestream:bytestream_go_proto",
11+
"@org_golang_google_genproto//googleapis/bytestream",
1212
"@org_golang_google_grpc//:grpc",
1313
],
1414
)

tests/integration/googleapis/BUILD.bazel

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ proto_library(
66
name = "color_service_proto",
77
srcs = ["color_service.proto"],
88
deps = [
9-
"@go_googleapis//google/rpc:status_proto",
10-
"@go_googleapis//google/type:color_proto",
9+
"@googleapis//google/rpc:status_proto",
10+
"@googleapis//google/type:color_proto",
1111
],
1212
)
1313

@@ -17,8 +17,8 @@ go_proto_library(
1717
importpath = "github.com/bazelbuild/rules_go/tests/integration/googleapis/color_service_proto",
1818
proto = ":color_service_proto",
1919
deps = [
20-
"@go_googleapis//google/rpc:status_go_proto",
21-
"@go_googleapis//google/type:color_go_proto",
20+
"@org_golang_google_genproto//googleapis/rpc/status",
21+
"@org_golang_google_genproto//googleapis/type/color",
2222
],
2323
)
2424

@@ -28,9 +28,9 @@ go_library(
2828
importpath = "github.com/bazelbuild/rules_go/tests/integration/googleapis/color_service",
2929
deps = [
3030
":color_service_go_proto",
31-
"@go_googleapis//google/rpc:code_go_proto",
32-
"@go_googleapis//google/rpc:status_go_proto",
33-
"@go_googleapis//google/type:color_go_proto",
31+
"@org_golang_google_genproto//googleapis/rpc/code",
32+
"@org_golang_google_genproto//googleapis/rpc/status",
33+
"@org_golang_google_genproto//googleapis/type/color",
3434
],
3535
)
3636

@@ -40,7 +40,7 @@ go_test(
4040
deps = [
4141
":color_service",
4242
":color_service_go_proto",
43-
"@go_googleapis//google/type:color_go_proto",
43+
"@org_golang_google_genproto//googleapis/type/color",
4444
"@org_golang_google_grpc//:go_default_library",
4545
],
4646
)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Functionality related to @go_googleapis
1+
Functionality related to Google APIs
22
=======================================
33

44
color_service_test
55
------------------
66

77
Verifies that a simple gRPC client and server can be built and run. .proto
8-
files are compiled at build time and depend on libraries in ``@go_googleapis``.
8+
files are compiled at build time and depend on libraries in Google APIs.

0 commit comments

Comments
 (0)