From gazelle-generated BUILD files, I get the following error when I run bazel build //foo/bar/protos/...:
ERROR: .../foo/bar/protos/BUILD.bazel:15:17: in deps attribute of go_proto_library rule //foo/bar/protos:protos_go_proto: '//baz/quux/api:api_proto' does not have mandatory providers: 'GoLibrary'
Both BUILD files have:
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
I have seen https://github.com/bazelbuild/rules_go/blob/master/go/providers.rst
, but it was more confusing.
I also asked this on the Gophers Slack, but there is very little traffic there.
This error means that
//baz/quux/api:api_proto
is the wrong kind of target for thedeps
attribute of thego_proto_library
rule (it does not "provide" the right information).//baz/quux/api:api_proto
is probably aproto_library
target, and should be in theprotos
attribute instead of thedeps
attribute: https://github.com/bazelbuild/rules_go/blob/master/proto/core.rst#go_proto_library