Closed fmeum closed 3 years ago
The go_rule wrapper has been removed in rules_go 0.25.0, which is also the first version of rules_go with support for Bazel 4.0.0.
go_rule
rules_go
I believe that the following patch helps:
--- gomock.bzl +++ gomock.bzl @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_context", "go_path", "go_rule") +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_context", "go_path") load("@io_bazel_rules_go//go/private:providers.bzl", "GoLibrary", "GoPath") _MOCKGEN_TOOL = "@com_github_golang_mock//mockgen" @@ -55,7 +55,7 @@ }, ) -_gomock_source = go_rule( +_gomock_source = rule( _gomock_source_impl, attrs = { "library": attr.label( @@ -107,7 +107,9 @@ cfg = "exec", mandatory = False, ), + "_go_context": attr.label(default = "@io_bazel_rules_go//:go_context_data"), }, + toolchains = ["@io_bazel_rules_go//go:toolchain"], ) def gomock(name, library, out, **kwargs): @@ -186,7 +188,7 @@ mnemonic = "GoMockReflectProgOnlyGen" ) -_gomock_prog_gen = go_rule( +_gomock_prog_gen = rule( _gomock_prog_gen_impl, attrs = { "library": attr.label( @@ -211,7 +213,9 @@ cfg = "exec", mandatory = False, ), + "_go_context": attr.label(default = "@io_bazel_rules_go//:go_context_data"), }, + toolchains = ["@io_bazel_rules_go//go:toolchain"], ) def _gomock_prog_exec_impl(ctx): @@ -239,7 +243,7 @@ mnemonic = "GoMockReflectExecOnlyGen", ) -_gomock_prog_exec = go_rule( +_gomock_prog_exec = rule( _gomock_prog_exec_impl, attrs = { "library": attr.label( @@ -289,7 +293,9 @@ cfg = "exec", mandatory = False, ), + "_go_context": attr.label(default = "@io_bazel_rules_go//:go_context_data"), }, + toolchains = ["@io_bazel_rules_go//go:toolchain"], ) def _handle_shared_args(ctx, args):
The
go_rule
wrapper has been removed inrules_go
0.25.0, which is also the first version ofrules_go
with support for Bazel 4.0.0.I believe that the following patch helps: