Skip to content

Commit

Permalink
prepare rules_go v 0.47 (#3923)
Browse files Browse the repository at this point in the history
This PR prepares the `rules_go` release `v0.47.0`. A few tests are no longer applicable in the `x/tools` repo.
  • Loading branch information
tyler-french committed Apr 23, 2024
1 parent 0f1e0ae commit 54d8f48
Show file tree
Hide file tree
Showing 11 changed files with 122,076 additions and 113,351 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "rules_go",
version = "0.46.0",
version = "0.47.0",
compatibility_level = 0,
repo_name = "io_bazel_rules_go",
)
Expand Down
2 changes: 1 addition & 1 deletion go/def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ TOOLS_NOGO = [str(Label(l)) for l in _TOOLS_NOGO]

# Current version or next version to be tagged. Gazelle and other tools may
# check this to determine compatibility.
RULES_GO_VERSION = "0.46.0"
RULES_GO_VERSION = "0.47.0"

go_context = _go_context
gomock = _gomock
Expand Down
68 changes: 34 additions & 34 deletions go/private/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def go_rules_dependencies(force = False):
wrapper(
http_archive,
name = "bazel_skylib",
# 1.5.0, latest as of 2023-12-15
# 1.5.0, latest as of 2024-04-19
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
Expand All @@ -65,13 +65,13 @@ def go_rules_dependencies(force = False):
wrapper(
http_archive,
name = "org_golang_x_tools",
# v0.15.0, latest as of 2023-11-16
# v0.20.0, latest as of 2024-04-19
urls = [
"https://mirror.bazel.build/github.com/golang/tools/archive/refs/tags/v0.15.0.zip",
"https://github.com/golang/tools/archive/refs/tags/v0.15.0.zip",
"https://mirror.bazel.build/github.com/golang/tools/archive/refs/tags/v0.20.0.zip",
"https://github.com/golang/tools/archive/refs/tags/v0.20.0.zip",
],
sha256 = "e76a03b11719138502c7fef44d5e1dc4469f8c2fcb2ee4a1d96fb09aaea13362",
strip_prefix = "tools-0.15.0",
sha256 = "06d29c1c1844c668bad5d57c755f5a11b99242f7a8ecd09c7b5f66aabeab32bc",
strip_prefix = "tools-0.20.0",
patches = [
# deletegopls removes the gopls subdirectory. It contains a nested
# module with additional dependencies. It's not needed by rules_go.
Expand Down Expand Up @@ -106,13 +106,13 @@ def go_rules_dependencies(force = False):
wrapper(
http_archive,
name = "org_golang_x_sys",
# v0.15.0, latest as of 2023-12-15
# v0.19.0, latest as of 2024-04-19
urls = [
"https://mirror.bazel.build/github.com/golang/sys/archive/refs/tags/v0.15.0.zip",
"https://github.com/golang/sys/archive/refs/tags/v0.15.0.zip",
"https://mirror.bazel.build/github.com/golang/sys/archive/refs/tags/v0.19.0.zip",
"https://github.com/golang/sys/archive/refs/tags/v0.19.0.zip",
],
sha256 = "36e7b6587b60eabebcd5102211ef5fabc6c6f40d93dd0db83dcefd13cdeb1b71",
strip_prefix = "sys-0.15.0",
sha256 = "a2fa1126030bf928b0ab559d2e985ea99fc974bf58a2d512f4e2e1a5303a57ae",
strip_prefix = "sys-0.19.0",
patches = [
# releaser:patch-cmd gazelle -repo_root . -go_prefix golang.org/x/sys -go_naming_convention import_alias
Label("//third_party:org_golang_x_sys-gazelle.patch"),
Expand All @@ -125,7 +125,7 @@ def go_rules_dependencies(force = False):
wrapper(
http_archive,
name = "org_golang_x_xerrors",
# master, as of 2023-12-15
# master, as of 2024-04-19
urls = [
"https://mirror.bazel.build/github.com/golang/xerrors/archive/104605ab7028f4af38a8aff92ac848a51bd53c5d.zip",
"https://github.com/golang/xerrors/archive/104605ab7028f4af38a8aff92ac848a51bd53c5d.zip",
Expand Down Expand Up @@ -160,13 +160,13 @@ def go_rules_dependencies(force = False):
wrapper(
http_archive,
name = "org_golang_google_protobuf",
sha256 = "f5d1f6d0e9b836aceb715f1df2dc065083a55b07ecec3b01b5e89d039b14da02",
# v1.31.0, latest as of 2023-12-15
sha256 = "39a8bbfadaa3e71f9d7741d67ee60d69db40422dc531708a777259e594d923e3",
# v1.33.0, latest as of 2024-04-19
urls = [
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf-go/archive/refs/tags/v1.31.0.zip",
"https://github.com/protocolbuffers/protobuf-go/archive/refs/tags/v1.31.0.zip",
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf-go/archive/refs/tags/v1.33.0.zip",
"https://github.com/protocolbuffers/protobuf-go/archive/refs/tags/v1.33.0.zip",
],
strip_prefix = "protobuf-go-1.31.0",
strip_prefix = "protobuf-go-1.33.0",
patches = [
# releaser:patch-cmd gazelle -repo_root . -go_prefix google.golang.org/protobuf -go_naming_convention import_alias -proto disable_global
Label("//third_party:org_golang_google_protobuf-gazelle.patch"),
Expand All @@ -180,7 +180,7 @@ def go_rules_dependencies(force = False):
http_archive,
name = "org_golang_google_grpc_cmd_protoc_gen_go_grpc",
sha256 = "1e84df03c94d1cded8e94da7a2df162463f3be4c7a94289d85c0871f14c7b8e3",
# cmd/protoc-gen-go-grpc/v1.3.0, latest as of 2023-12-13
# cmd/protoc-gen-go-grpc/v1.3.0, latest as of 2024-04-19
urls = [
"https://mirror.bazel.build/github.com/grpc/grpc-go/archive/refs/tags/cmd/protoc-gen-go-grpc/v1.3.0.zip",
"https://github.com/grpc/grpc-go/archive/refs/tags/cmd/protoc-gen-go-grpc/v1.3.0.zip",
Expand All @@ -200,13 +200,13 @@ def go_rules_dependencies(force = False):
wrapper(
http_archive,
name = "com_github_golang_protobuf",
# v1.5.3, latest as of 2023-12-15
# v1.5.4, latest as of 2024-04-19
urls = [
"https://mirror.bazel.build/github.com/golang/protobuf/archive/refs/tags/v1.5.3.zip",
"https://github.com/golang/protobuf/archive/refs/tags/v1.5.3.zip",
"https://mirror.bazel.build/github.com/golang/protobuf/archive/refs/tags/v1.5.4.zip",
"https://github.com/golang/protobuf/archive/refs/tags/v1.5.4.zip",
],
sha256 = "2dced4544ae5372281e20f1e48ca76368355a01b31353724718c4d6e3dcbb430",
strip_prefix = "protobuf-1.5.3",
sha256 = "9efeb4561ed4fbb9cefe97da407bb7b6247d4ed3dee4bfc2c24fc03dd4b5596d",
strip_prefix = "protobuf-1.5.4",
patches = [
# releaser:patch-cmd gazelle -repo_root . -go_prefix github.com/golang/protobuf -go_naming_convention import_alias -proto disable_global
Label("//third_party:com_github_golang_protobuf-gazelle.patch"),
Expand All @@ -218,7 +218,7 @@ def go_rules_dependencies(force = False):
wrapper(
http_archive,
name = "com_github_gogo_protobuf",
# v1.3.2, latest as of 2023-12-15
# v1.3.2, latest as of 2024-04-19
urls = [
"https://mirror.bazel.build/github.com/gogo/protobuf/archive/refs/tags/v1.3.2.zip",
"https://github.com/gogo/protobuf/archive/refs/tags/v1.3.2.zip",
Expand All @@ -244,13 +244,13 @@ def go_rules_dependencies(force = False):
wrapper(
http_archive,
name = "org_golang_google_genproto",
# main, as of 2023-12-15
# main, as of 2024-04-19
urls = [
"https://mirror.bazel.build/github.com/googleapis/go-genproto/archive/995d672761c0c5b9ac6127b488b48825f9a2e5fb.zip",
"https://github.com/googleapis/go-genproto/archive/995d672761c0c5b9ac6127b488b48825f9a2e5fb.zip",
"https://mirror.bazel.build/github.com/googleapis/go-genproto/archive/8c6c420018be7d99c6336d84554d856523d514bf.zip",
"https://github.com/googleapis/go-genproto/archive/8c6c420018be7d99c6336d84554d856523d514bf.zip",
],
sha256 = "14164722fe3c601a0515a911b319a4d6a397f96ee74d9c12b57e5b5501f8cb48",
strip_prefix = "go-genproto-995d672761c0c5b9ac6127b488b48825f9a2e5fb",
sha256 = "eddb238f5a61df730989baa6e0303666af3adf2835f226185e6c64f2958855c9",
strip_prefix = "go-genproto-8c6c420018be7d99c6336d84554d856523d514bf",
patches = [
# releaser:patch-cmd gazelle -repo_root . -go_prefix google.golang.org/genproto -go_naming_convention import_alias -proto disable_global
Label("//third_party:org_golang_google_genproto-gazelle.patch"),
Expand All @@ -262,18 +262,18 @@ def go_rules_dependencies(force = False):
_maybe(
http_archive,
name = "com_github_golang_mock",
# v1.7.0-rc.1, latest as of 2023-12-18
# v1.6.0, latest as of 2024-04-19
urls = [
"https://mirror.bazel.build/github.com/golang/mock/archive/refs/tags/v1.7.0-rc.1.zip",
"https://github.com/golang/mock/archive/refs/tags/v1.7.0-rc.1.zip",
"https://mirror.bazel.build/github.com/golang/mock/archive/refs/tags/v1.6.0.zip",
"https://github.com/golang/mock/archive/refs/tags/v1.6.0.zip",
],
patches = [
# releaser:patch-cmd gazelle -repo_root . -go_prefix github.com/golang/mock -go_naming_convention import_alias
Label("//third_party:com_github_golang_mock-gazelle.patch"),
],
patch_args = ["-p1"],
sha256 = "5359c78b0c1649cf7beb3b48ff8b1d1aaf0243b22ea4789aba94805280075d8e",
strip_prefix = "mock-1.7.0-rc.1",
sha256 = "604d9ab25b07d60c1b8ba6d3ea2e66873138edeed2e561c5358de804ea421a0e",
strip_prefix = "mock-1.6.0",
)

# This may be overridden by go_register_toolchains, but it's not mandatory
Expand Down
4 changes: 0 additions & 4 deletions tests/integration/popular_repos/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ test_suite(
"@org_golang_x_tools//benchmark/parse:parse_test",
"@org_golang_x_tools//cmd/benchcmp:benchcmp_test",
"@org_golang_x_tools//cmd/digraph:digraph_test",
"@org_golang_x_tools//cmd/getgo:getgo_test",
"@org_golang_x_tools//cmd/go-contrib-init:go-contrib-init_test",
"@org_golang_x_tools//cmd/splitdwarf/internal/macho:macho_test",
"@org_golang_x_tools//cover:cover_test",
Expand All @@ -173,7 +172,6 @@ test_suite(
"@org_golang_x_tools//go/callgraph:callgraph_test",
"@org_golang_x_tools//go/callgraph/static:static_test",
"@org_golang_x_tools//go/callgraph/vta/internal/trie:trie_test",
"@org_golang_x_tools//go/cfg:cfg_test",
"@org_golang_x_tools//godoc/redirect:redirect_test",
"@org_golang_x_tools//godoc/vfs:vfs_test",
"@org_golang_x_tools//godoc/vfs/gatefs:gatefs_test",
Expand All @@ -192,7 +190,6 @@ test_suite(
"@org_golang_x_tools//internal/jsonrpc2/servertest:servertest_test",
"@org_golang_x_tools//internal/jsonrpc2_v2:jsonrpc2_v2_test",
"@org_golang_x_tools//internal/memoize:memoize_test",
"@org_golang_x_tools//internal/persistent:persistent_test",
"@org_golang_x_tools//internal/proxydir:proxydir_test",
"@org_golang_x_tools//internal/robustio:robustio_test",
"@org_golang_x_tools//internal/stack:stack_test",
Expand Down Expand Up @@ -260,7 +257,6 @@ build_test(
"@org_golang_x_tools//cmd/file2fuzz:file2fuzz",
"@org_golang_x_tools//cmd/fiximports:fiximports",
"@org_golang_x_tools//cmd/gorename:gorename",
"@org_golang_x_tools//cmd/guru:guru",
"@org_golang_x_tools//cmd/signature-fuzzer/fuzz-driver:fuzz-driver",
"@org_golang_x_tools//cmd/signature-fuzzer/fuzz-runner:fuzz-runner",
"@org_golang_x_tools//cmd/stringer:stringer",
Expand Down
77 changes: 7 additions & 70 deletions third_party/com_github_golang_mock-gazelle.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -urN a/gomock/BUILD.bazel b/gomock/BUILD.bazel
--- a/gomock/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
+++ b/gomock/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
@@ -0,0 +1,34 @@
@@ -0,0 +1,35 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
Expand All @@ -10,7 +10,6 @@ diff -urN a/gomock/BUILD.bazel b/gomock/BUILD.bazel
+ "call.go",
+ "callset.go",
+ "controller.go",
+ "doc.go",
+ "matchers.go",
+ ],
+ importpath = "github.com/golang/mock/gomock",
Expand All @@ -28,6 +27,8 @@ diff -urN a/gomock/BUILD.bazel b/gomock/BUILD.bazel
+ srcs = [
+ "call_test.go",
+ "callset_test.go",
+ "controller_113_test.go",
+ "controller_114_test.go",
+ "controller_test.go",
+ "example_test.go",
+ "matchers_test.go",
Expand Down Expand Up @@ -58,18 +59,17 @@ diff -urN a/gomock/internal/mock_gomock/BUILD.bazel b/gomock/internal/mock_gomoc
diff -urN a/mockgen/BUILD.bazel b/mockgen/BUILD.bazel
--- a/mockgen/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
+++ b/mockgen/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
@@ -0,0 +1,36 @@
@@ -0,0 +1,35 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+ name = "mockgen_lib",
+ srcs = [
+ "generic_go118.go",
+ "generic_notgo118.go",
+ "mockgen.go",
+ "parse.go",
+ "reflect.go",
+ "version.go",
+ "version.1.11.go",
+ "version.1.12.go",
+ ],
+ importpath = "github.com/golang/mock/mockgen",
+ visibility = ["//visibility:private"],
Expand Down Expand Up @@ -355,80 +355,17 @@ diff -urN a/mockgen/internal/tests/generated_identifier_conflict/BUILD.bazel b/m
+ embed = [":generated_identifier_conflict"],
+ deps = ["//gomock"],
+)
diff -urN a/mockgen/internal/tests/generics/BUILD.bazel b/mockgen/internal/tests/generics/BUILD.bazel
--- a/mockgen/internal/tests/generics/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
+++ b/mockgen/internal/tests/generics/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "generics",
+ srcs = [
+ "external.go",
+ "generics.go",
+ ],
+ importpath = "github.com/golang/mock/mockgen/internal/tests/generics",
+ visibility = ["//mockgen:__subpackages__"],
+ deps = [
+ "//mockgen/internal/tests/generics/other",
+ "@org_golang_x_exp//constraints:go_default_library",
+ ],
+)
+
+alias(
+ name = "go_default_library",
+ actual = ":generics",
+ visibility = ["//mockgen:__subpackages__"],
+)
diff -urN a/mockgen/internal/tests/generics/other/BUILD.bazel b/mockgen/internal/tests/generics/other/BUILD.bazel
--- a/mockgen/internal/tests/generics/other/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
+++ b/mockgen/internal/tests/generics/other/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "other",
+ srcs = ["other.go"],
+ importpath = "github.com/golang/mock/mockgen/internal/tests/generics/other",
+ visibility = ["//mockgen:__subpackages__"],
+)
+
+alias(
+ name = "go_default_library",
+ actual = ":other",
+ visibility = ["//mockgen:__subpackages__"],
+)
diff -urN a/mockgen/internal/tests/generics/source/BUILD.bazel b/mockgen/internal/tests/generics/source/BUILD.bazel
--- a/mockgen/internal/tests/generics/source/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
+++ b/mockgen/internal/tests/generics/source/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
@@ -0,0 +1,15 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_test")
+
+go_test(
+ name = "source_test",
+ srcs = [
+ "mock_external_test.go",
+ "mock_generics_test.go",
+ ],
+ deps = [
+ "//gomock",
+ "//mockgen/internal/tests/generics",
+ "//mockgen/internal/tests/generics/other",
+ "@org_golang_x_exp//constraints:go_default_library",
+ ],
+)
diff -urN a/mockgen/internal/tests/import_embedded_interface/BUILD.bazel b/mockgen/internal/tests/import_embedded_interface/BUILD.bazel
--- a/mockgen/internal/tests/import_embedded_interface/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
+++ b/mockgen/internal/tests/import_embedded_interface/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
@@ -0,0 +1,36 @@
@@ -0,0 +1,35 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+ name = "import_embedded_interface",
+ srcs = [
+ "bugreport.go",
+ "bugreport_mock.go",
+ "foo.go",
+ "net.go",
+ "net_mock.go",
+ ],
Expand Down
Loading

0 comments on commit 54d8f48

Please sign in to comment.