Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to generate *.pb.validate.go files using Bazel and Gazelle #833

Closed
AFMiziara opened this issue Apr 6, 2023 · 4 comments
Closed
Labels
Bazel Bazel related issues Go Go language support

Comments

@AFMiziara
Copy link

AFMiziara commented Apr 6, 2023

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.

@AFMiziara AFMiziara changed the title Trying to generate *.pb.validate.go files using Bazel Trying to generate *.pb.validate.go files using Bazel and Gazelle Apr 6, 2023
@AFMiziara
Copy link
Author

I have updated protoc-gen-validate and now I am facing the same issue as #535

@rodaine rodaine added Go Go language support Bazel Bazel related issues labels Apr 20, 2023
@alexbozhenko
Copy link
Contributor

@AFMiziara FYI should be fixed in https://github.com/bufbuild/protoc-gen-validate/releases/tag/v1.0.2

@AFMiziara
Copy link
Author

Thank you for the heads up @alexbozhenko

@chrispine
Copy link
Contributor

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!

@chrispine chrispine closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bazel Bazel related issues Go Go language support
Projects
None yet
Development

No branches or pull requests

4 participants