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

Is there any native support for rules_proto_grpc rule to work with bazel-gazelle? #220

Open
teabuff opened this issue Oct 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@teabuff
Copy link

teabuff commented Oct 15, 2022

Description

Hi,

I am using bazel-gazelle to automate the BUILD file generator and dependency management. But it seems gazelle does not natively work with the rules_proto_grpc. E.g. I have an example.proto which defines a simple the grpc service and runs gazelle by default generate the following BUILD file:

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")

proto_library(
    name = "example_proto",
    srcs = ["example.proto"],
)

go_proto_library(
    name = "example_go_proto",
    compilers = ["@io_bazel_rules_go//proto:go_grpc"],
    importpath = "github.com/<account>/<repo>/samples/proto/example",
    proto = ":example_proto",
)

go_library(
    name = "example",
    embed = [":example_go_proto"],
    importpath = "github.com/<account>/<repo>/samples/proto/example",
)

Looks like it is using the rules_proto rule instead of those rules defined in the rules_proto_grpc. Is there any support similar to https://github.com/stackb/rules_proto#gazelle-configuration that instruct gazelle to use the rules_proto_grpc correctly like the following:

load("@rules_proto_grpc//go:defs.bzl", "go_grpc_library")

go_grpc_library(
    name = "example_go_grpc",
    importpath = "github.com/<account>/<repo>/samples/proto/example",
    protos = [":example_proto"],
)

Thank you so much!

@aaliddell
Copy link
Member

These rules have no Gazelle plugin, so unfortunately you won't get auto-generated rules for your proto library targets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants