Skip to content

Commit 54d8f48

Browse files
authored
prepare rules_go v 0.47 (#3923)
This PR prepares the `rules_go` release `v0.47.0`. A few tests are no longer applicable in the `x/tools` repo.
1 parent 0f1e0ae commit 54d8f48

11 files changed

+122076
-113351
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "rules_go",
3-
version = "0.46.0",
3+
version = "0.47.0",
44
compatibility_level = 0,
55
repo_name = "io_bazel_rules_go",
66
)

go/def.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ TOOLS_NOGO = [str(Label(l)) for l in _TOOLS_NOGO]
121121

122122
# Current version or next version to be tagged. Gazelle and other tools may
123123
# check this to determine compatibility.
124-
RULES_GO_VERSION = "0.46.0"
124+
RULES_GO_VERSION = "0.47.0"
125125

126126
go_context = _go_context
127127
gomock = _gomock

go/private/repositories.bzl

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def go_rules_dependencies(force = False):
5151
wrapper(
5252
http_archive,
5353
name = "bazel_skylib",
54-
# 1.5.0, latest as of 2023-12-15
54+
# 1.5.0, latest as of 2024-04-19
5555
urls = [
5656
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
5757
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
@@ -65,13 +65,13 @@ def go_rules_dependencies(force = False):
6565
wrapper(
6666
http_archive,
6767
name = "org_golang_x_tools",
68-
# v0.15.0, latest as of 2023-11-16
68+
# v0.20.0, latest as of 2024-04-19
6969
urls = [
70-
"https://mirror.bazel.build/github.com/golang/tools/archive/refs/tags/v0.15.0.zip",
71-
"https://github.com/golang/tools/archive/refs/tags/v0.15.0.zip",
70+
"https://mirror.bazel.build/github.com/golang/tools/archive/refs/tags/v0.20.0.zip",
71+
"https://github.com/golang/tools/archive/refs/tags/v0.20.0.zip",
7272
],
73-
sha256 = "e76a03b11719138502c7fef44d5e1dc4469f8c2fcb2ee4a1d96fb09aaea13362",
74-
strip_prefix = "tools-0.15.0",
73+
sha256 = "06d29c1c1844c668bad5d57c755f5a11b99242f7a8ecd09c7b5f66aabeab32bc",
74+
strip_prefix = "tools-0.20.0",
7575
patches = [
7676
# deletegopls removes the gopls subdirectory. It contains a nested
7777
# module with additional dependencies. It's not needed by rules_go.
@@ -106,13 +106,13 @@ def go_rules_dependencies(force = False):
106106
wrapper(
107107
http_archive,
108108
name = "org_golang_x_sys",
109-
# v0.15.0, latest as of 2023-12-15
109+
# v0.19.0, latest as of 2024-04-19
110110
urls = [
111-
"https://mirror.bazel.build/github.com/golang/sys/archive/refs/tags/v0.15.0.zip",
112-
"https://github.com/golang/sys/archive/refs/tags/v0.15.0.zip",
111+
"https://mirror.bazel.build/github.com/golang/sys/archive/refs/tags/v0.19.0.zip",
112+
"https://github.com/golang/sys/archive/refs/tags/v0.19.0.zip",
113113
],
114-
sha256 = "36e7b6587b60eabebcd5102211ef5fabc6c6f40d93dd0db83dcefd13cdeb1b71",
115-
strip_prefix = "sys-0.15.0",
114+
sha256 = "a2fa1126030bf928b0ab559d2e985ea99fc974bf58a2d512f4e2e1a5303a57ae",
115+
strip_prefix = "sys-0.19.0",
116116
patches = [
117117
# releaser:patch-cmd gazelle -repo_root . -go_prefix golang.org/x/sys -go_naming_convention import_alias
118118
Label("//third_party:org_golang_x_sys-gazelle.patch"),
@@ -125,7 +125,7 @@ def go_rules_dependencies(force = False):
125125
wrapper(
126126
http_archive,
127127
name = "org_golang_x_xerrors",
128-
# master, as of 2023-12-15
128+
# master, as of 2024-04-19
129129
urls = [
130130
"https://mirror.bazel.build/github.com/golang/xerrors/archive/104605ab7028f4af38a8aff92ac848a51bd53c5d.zip",
131131
"https://github.com/golang/xerrors/archive/104605ab7028f4af38a8aff92ac848a51bd53c5d.zip",
@@ -160,13 +160,13 @@ def go_rules_dependencies(force = False):
160160
wrapper(
161161
http_archive,
162162
name = "org_golang_google_protobuf",
163-
sha256 = "f5d1f6d0e9b836aceb715f1df2dc065083a55b07ecec3b01b5e89d039b14da02",
164-
# v1.31.0, latest as of 2023-12-15
163+
sha256 = "39a8bbfadaa3e71f9d7741d67ee60d69db40422dc531708a777259e594d923e3",
164+
# v1.33.0, latest as of 2024-04-19
165165
urls = [
166-
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf-go/archive/refs/tags/v1.31.0.zip",
167-
"https://github.com/protocolbuffers/protobuf-go/archive/refs/tags/v1.31.0.zip",
166+
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf-go/archive/refs/tags/v1.33.0.zip",
167+
"https://github.com/protocolbuffers/protobuf-go/archive/refs/tags/v1.33.0.zip",
168168
],
169-
strip_prefix = "protobuf-go-1.31.0",
169+
strip_prefix = "protobuf-go-1.33.0",
170170
patches = [
171171
# releaser:patch-cmd gazelle -repo_root . -go_prefix google.golang.org/protobuf -go_naming_convention import_alias -proto disable_global
172172
Label("//third_party:org_golang_google_protobuf-gazelle.patch"),
@@ -180,7 +180,7 @@ def go_rules_dependencies(force = False):
180180
http_archive,
181181
name = "org_golang_google_grpc_cmd_protoc_gen_go_grpc",
182182
sha256 = "1e84df03c94d1cded8e94da7a2df162463f3be4c7a94289d85c0871f14c7b8e3",
183-
# cmd/protoc-gen-go-grpc/v1.3.0, latest as of 2023-12-13
183+
# cmd/protoc-gen-go-grpc/v1.3.0, latest as of 2024-04-19
184184
urls = [
185185
"https://mirror.bazel.build/github.com/grpc/grpc-go/archive/refs/tags/cmd/protoc-gen-go-grpc/v1.3.0.zip",
186186
"https://github.com/grpc/grpc-go/archive/refs/tags/cmd/protoc-gen-go-grpc/v1.3.0.zip",
@@ -200,13 +200,13 @@ def go_rules_dependencies(force = False):
200200
wrapper(
201201
http_archive,
202202
name = "com_github_golang_protobuf",
203-
# v1.5.3, latest as of 2023-12-15
203+
# v1.5.4, latest as of 2024-04-19
204204
urls = [
205-
"https://mirror.bazel.build/github.com/golang/protobuf/archive/refs/tags/v1.5.3.zip",
206-
"https://github.com/golang/protobuf/archive/refs/tags/v1.5.3.zip",
205+
"https://mirror.bazel.build/github.com/golang/protobuf/archive/refs/tags/v1.5.4.zip",
206+
"https://github.com/golang/protobuf/archive/refs/tags/v1.5.4.zip",
207207
],
208-
sha256 = "2dced4544ae5372281e20f1e48ca76368355a01b31353724718c4d6e3dcbb430",
209-
strip_prefix = "protobuf-1.5.3",
208+
sha256 = "9efeb4561ed4fbb9cefe97da407bb7b6247d4ed3dee4bfc2c24fc03dd4b5596d",
209+
strip_prefix = "protobuf-1.5.4",
210210
patches = [
211211
# releaser:patch-cmd gazelle -repo_root . -go_prefix github.com/golang/protobuf -go_naming_convention import_alias -proto disable_global
212212
Label("//third_party:com_github_golang_protobuf-gazelle.patch"),
@@ -218,7 +218,7 @@ def go_rules_dependencies(force = False):
218218
wrapper(
219219
http_archive,
220220
name = "com_github_gogo_protobuf",
221-
# v1.3.2, latest as of 2023-12-15
221+
# v1.3.2, latest as of 2024-04-19
222222
urls = [
223223
"https://mirror.bazel.build/github.com/gogo/protobuf/archive/refs/tags/v1.3.2.zip",
224224
"https://github.com/gogo/protobuf/archive/refs/tags/v1.3.2.zip",
@@ -244,13 +244,13 @@ def go_rules_dependencies(force = False):
244244
wrapper(
245245
http_archive,
246246
name = "org_golang_google_genproto",
247-
# main, as of 2023-12-15
247+
# main, as of 2024-04-19
248248
urls = [
249-
"https://mirror.bazel.build/github.com/googleapis/go-genproto/archive/995d672761c0c5b9ac6127b488b48825f9a2e5fb.zip",
250-
"https://github.com/googleapis/go-genproto/archive/995d672761c0c5b9ac6127b488b48825f9a2e5fb.zip",
249+
"https://mirror.bazel.build/github.com/googleapis/go-genproto/archive/8c6c420018be7d99c6336d84554d856523d514bf.zip",
250+
"https://github.com/googleapis/go-genproto/archive/8c6c420018be7d99c6336d84554d856523d514bf.zip",
251251
],
252-
sha256 = "14164722fe3c601a0515a911b319a4d6a397f96ee74d9c12b57e5b5501f8cb48",
253-
strip_prefix = "go-genproto-995d672761c0c5b9ac6127b488b48825f9a2e5fb",
252+
sha256 = "eddb238f5a61df730989baa6e0303666af3adf2835f226185e6c64f2958855c9",
253+
strip_prefix = "go-genproto-8c6c420018be7d99c6336d84554d856523d514bf",
254254
patches = [
255255
# releaser:patch-cmd gazelle -repo_root . -go_prefix google.golang.org/genproto -go_naming_convention import_alias -proto disable_global
256256
Label("//third_party:org_golang_google_genproto-gazelle.patch"),
@@ -262,18 +262,18 @@ def go_rules_dependencies(force = False):
262262
_maybe(
263263
http_archive,
264264
name = "com_github_golang_mock",
265-
# v1.7.0-rc.1, latest as of 2023-12-18
265+
# v1.6.0, latest as of 2024-04-19
266266
urls = [
267-
"https://mirror.bazel.build/github.com/golang/mock/archive/refs/tags/v1.7.0-rc.1.zip",
268-
"https://github.com/golang/mock/archive/refs/tags/v1.7.0-rc.1.zip",
267+
"https://mirror.bazel.build/github.com/golang/mock/archive/refs/tags/v1.6.0.zip",
268+
"https://github.com/golang/mock/archive/refs/tags/v1.6.0.zip",
269269
],
270270
patches = [
271271
# releaser:patch-cmd gazelle -repo_root . -go_prefix github.com/golang/mock -go_naming_convention import_alias
272272
Label("//third_party:com_github_golang_mock-gazelle.patch"),
273273
],
274274
patch_args = ["-p1"],
275-
sha256 = "5359c78b0c1649cf7beb3b48ff8b1d1aaf0243b22ea4789aba94805280075d8e",
276-
strip_prefix = "mock-1.7.0-rc.1",
275+
sha256 = "604d9ab25b07d60c1b8ba6d3ea2e66873138edeed2e561c5358de804ea421a0e",
276+
strip_prefix = "mock-1.6.0",
277277
)
278278

279279
# This may be overridden by go_register_toolchains, but it's not mandatory

tests/integration/popular_repos/BUILD.bazel

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ test_suite(
162162
"@org_golang_x_tools//benchmark/parse:parse_test",
163163
"@org_golang_x_tools//cmd/benchcmp:benchcmp_test",
164164
"@org_golang_x_tools//cmd/digraph:digraph_test",
165-
"@org_golang_x_tools//cmd/getgo:getgo_test",
166165
"@org_golang_x_tools//cmd/go-contrib-init:go-contrib-init_test",
167166
"@org_golang_x_tools//cmd/splitdwarf/internal/macho:macho_test",
168167
"@org_golang_x_tools//cover:cover_test",
@@ -173,7 +172,6 @@ test_suite(
173172
"@org_golang_x_tools//go/callgraph:callgraph_test",
174173
"@org_golang_x_tools//go/callgraph/static:static_test",
175174
"@org_golang_x_tools//go/callgraph/vta/internal/trie:trie_test",
176-
"@org_golang_x_tools//go/cfg:cfg_test",
177175
"@org_golang_x_tools//godoc/redirect:redirect_test",
178176
"@org_golang_x_tools//godoc/vfs:vfs_test",
179177
"@org_golang_x_tools//godoc/vfs/gatefs:gatefs_test",
@@ -192,7 +190,6 @@ test_suite(
192190
"@org_golang_x_tools//internal/jsonrpc2/servertest:servertest_test",
193191
"@org_golang_x_tools//internal/jsonrpc2_v2:jsonrpc2_v2_test",
194192
"@org_golang_x_tools//internal/memoize:memoize_test",
195-
"@org_golang_x_tools//internal/persistent:persistent_test",
196193
"@org_golang_x_tools//internal/proxydir:proxydir_test",
197194
"@org_golang_x_tools//internal/robustio:robustio_test",
198195
"@org_golang_x_tools//internal/stack:stack_test",
@@ -260,7 +257,6 @@ build_test(
260257
"@org_golang_x_tools//cmd/file2fuzz:file2fuzz",
261258
"@org_golang_x_tools//cmd/fiximports:fiximports",
262259
"@org_golang_x_tools//cmd/gorename:gorename",
263-
"@org_golang_x_tools//cmd/guru:guru",
264260
"@org_golang_x_tools//cmd/signature-fuzzer/fuzz-driver:fuzz-driver",
265261
"@org_golang_x_tools//cmd/signature-fuzzer/fuzz-runner:fuzz-runner",
266262
"@org_golang_x_tools//cmd/stringer:stringer",

third_party/com_github_golang_mock-gazelle.patch

Lines changed: 7 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
diff -urN a/gomock/BUILD.bazel b/gomock/BUILD.bazel
22
--- a/gomock/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
33
+++ b/gomock/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
4-
@@ -0,0 +1,34 @@
4+
@@ -0,0 +1,35 @@
55
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
66
+
77
+go_library(
@@ -10,7 +10,6 @@ diff -urN a/gomock/BUILD.bazel b/gomock/BUILD.bazel
1010
+ "call.go",
1111
+ "callset.go",
1212
+ "controller.go",
13-
+ "doc.go",
1413
+ "matchers.go",
1514
+ ],
1615
+ importpath = "github.com/golang/mock/gomock",
@@ -28,6 +27,8 @@ diff -urN a/gomock/BUILD.bazel b/gomock/BUILD.bazel
2827
+ srcs = [
2928
+ "call_test.go",
3029
+ "callset_test.go",
30+
+ "controller_113_test.go",
31+
+ "controller_114_test.go",
3132
+ "controller_test.go",
3233
+ "example_test.go",
3334
+ "matchers_test.go",
@@ -58,18 +59,17 @@ diff -urN a/gomock/internal/mock_gomock/BUILD.bazel b/gomock/internal/mock_gomoc
5859
diff -urN a/mockgen/BUILD.bazel b/mockgen/BUILD.bazel
5960
--- a/mockgen/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
6061
+++ b/mockgen/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
61-
@@ -0,0 +1,36 @@
62+
@@ -0,0 +1,35 @@
6263
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
6364
+
6465
+go_library(
6566
+ name = "mockgen_lib",
6667
+ srcs = [
67-
+ "generic_go118.go",
68-
+ "generic_notgo118.go",
6968
+ "mockgen.go",
7069
+ "parse.go",
7170
+ "reflect.go",
72-
+ "version.go",
71+
+ "version.1.11.go",
72+
+ "version.1.12.go",
7373
+ ],
7474
+ importpath = "github.com/golang/mock/mockgen",
7575
+ visibility = ["//visibility:private"],
@@ -355,80 +355,17 @@ diff -urN a/mockgen/internal/tests/generated_identifier_conflict/BUILD.bazel b/m
355355
+ embed = [":generated_identifier_conflict"],
356356
+ deps = ["//gomock"],
357357
+)
358-
diff -urN a/mockgen/internal/tests/generics/BUILD.bazel b/mockgen/internal/tests/generics/BUILD.bazel
359-
--- a/mockgen/internal/tests/generics/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
360-
+++ b/mockgen/internal/tests/generics/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
361-
@@ -0,0 +1,21 @@
362-
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
363-
+
364-
+go_library(
365-
+ name = "generics",
366-
+ srcs = [
367-
+ "external.go",
368-
+ "generics.go",
369-
+ ],
370-
+ importpath = "github.com/golang/mock/mockgen/internal/tests/generics",
371-
+ visibility = ["//mockgen:__subpackages__"],
372-
+ deps = [
373-
+ "//mockgen/internal/tests/generics/other",
374-
+ "@org_golang_x_exp//constraints:go_default_library",
375-
+ ],
376-
+)
377-
+
378-
+alias(
379-
+ name = "go_default_library",
380-
+ actual = ":generics",
381-
+ visibility = ["//mockgen:__subpackages__"],
382-
+)
383-
diff -urN a/mockgen/internal/tests/generics/other/BUILD.bazel b/mockgen/internal/tests/generics/other/BUILD.bazel
384-
--- a/mockgen/internal/tests/generics/other/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
385-
+++ b/mockgen/internal/tests/generics/other/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
386-
@@ -0,0 +1,14 @@
387-
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
388-
+
389-
+go_library(
390-
+ name = "other",
391-
+ srcs = ["other.go"],
392-
+ importpath = "github.com/golang/mock/mockgen/internal/tests/generics/other",
393-
+ visibility = ["//mockgen:__subpackages__"],
394-
+)
395-
+
396-
+alias(
397-
+ name = "go_default_library",
398-
+ actual = ":other",
399-
+ visibility = ["//mockgen:__subpackages__"],
400-
+)
401-
diff -urN a/mockgen/internal/tests/generics/source/BUILD.bazel b/mockgen/internal/tests/generics/source/BUILD.bazel
402-
--- a/mockgen/internal/tests/generics/source/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
403-
+++ b/mockgen/internal/tests/generics/source/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
404-
@@ -0,0 +1,15 @@
405-
+load("@io_bazel_rules_go//go:def.bzl", "go_test")
406-
+
407-
+go_test(
408-
+ name = "source_test",
409-
+ srcs = [
410-
+ "mock_external_test.go",
411-
+ "mock_generics_test.go",
412-
+ ],
413-
+ deps = [
414-
+ "//gomock",
415-
+ "//mockgen/internal/tests/generics",
416-
+ "//mockgen/internal/tests/generics/other",
417-
+ "@org_golang_x_exp//constraints:go_default_library",
418-
+ ],
419-
+)
420358
diff -urN a/mockgen/internal/tests/import_embedded_interface/BUILD.bazel b/mockgen/internal/tests/import_embedded_interface/BUILD.bazel
421359
--- a/mockgen/internal/tests/import_embedded_interface/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
422360
+++ b/mockgen/internal/tests/import_embedded_interface/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
423-
@@ -0,0 +1,36 @@
361+
@@ -0,0 +1,35 @@
424362
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
425363
+
426364
+go_library(
427365
+ name = "import_embedded_interface",
428366
+ srcs = [
429367
+ "bugreport.go",
430368
+ "bugreport_mock.go",
431-
+ "foo.go",
432369
+ "net.go",
433370
+ "net_mock.go",
434371
+ ],

0 commit comments

Comments
 (0)