protoc-gen-validate
protoc-gen-validate copied to clipboard
Trying to generate `*.pb.validate.go` files using Bazel and Gazelle
So I have loaded protoc-gen-validate
in my WORKSPACE, like that:
# Load protoc-gen-validate plugin used within protobuf files.
http_archive(
name = "com_envoyproxy_protoc_gen_validate", # 2023-03-20
sha256 = "884f7166893d4869d9e86c171777c11e51b138a6ec170e1d8eba8f091a9ef85a",
strip_prefix = "protoc-gen-validate-0.10.1",
urls = [
"https://github.com/bufbuild/protoc-gen-validate/archive/refs/tags/v0.10.1.tar.gz",
],
)
load("@com_envoyproxy_protoc_gen_validate//bazel:repositories.bzl", "pgv_dependencies")
pgv_dependencies()
And I added this gazelle directive, as suggested here:
# gazelle:go_proto_compilers @com_envoyproxy_protoc_gen_validate//bazel/go:pgv_plugin_go, @io_bazel_rules_go//proto:go_proto
gazelle(
name = "gazelle",
gazelle = "//:gazelle_binary",
)
When I try to bazel build //...
I got this error:
compilepkg: missing strict dependencies:
/private/var/tmp/_bazel_xxx/f7366cb40f218cae24698ffbd08f4bf3/sandbox/darwin-sandbox/2751/execroot/io_xxx_go/external/com_envoyproxy_protoc_gen_validate/templates/shared/context.go: import of "github.com/lyft/protoc-gen-star/v2"
What am I missing here? Looks like bazel is not loading some go dependencies from protoc-gen-validate
.
I have updated protoc-gen-validate
and now I am facing the same issue as https://github.com/bufbuild/protoc-gen-validate/issues/535
@AFMiziara FYI should be fixed in https://github.com/bufbuild/protoc-gen-validate/releases/tag/v1.0.2
Thank you for the heads up @alexbozhenko
Hello, thanks for your interest! As explained in the README, this project is in maintenance mode. We recommend upgrading to protovalidate.
I'm going to go ahead and close this issue, but feel free to open one against protovalidate if needed. Thanks!