bazel-contrib / rules_go

Go rules for Bazel
Apache License 2.0
1.38k stars 662 forks source link

Use protoc-gen-go-grpc for gRPC compilers #3022

Closed tigersoldier closed 10 months ago

tigersoldier commented 2 years ago

The generated gRPC code is different from the result of the protoc-gen-go-grpc plugin. By reading the rule definition, it seems that rules_go is using the deprecated grpc mode mode in proto-gen-go.

Currently I'm working around it with creating my own rule for the grpc-go proto compiler, but the official bazel rules should provide it.

What version of rules_go are you using?

0.29.0

What version of gazelle are you using?

0.24.0

What version of Bazel are you using?

4.2.1-homebrew

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

MacOS 12.0.1 Montery

Any other potentially useful information about your toolchain?

N/A

What did you do?

bazel build a proto with service defined and compiler using @io_bazel_rules_go//proto:go_grpc

What did you expect to see?

The generated code should have var <ServiceName>_ServiceDesc = ...

What did you see instead?

The generated code has var _<ServiceName>_ServiceDesc = ...

robfig commented 2 years ago

Thank you for reporting this. If you're interested and have the bandwidth to contribute that change, I'd be happy to merge it.

sessfeld commented 1 year ago

I'd like to open this back up again. I send a PR, but I believe it'd also require a change to Gazelle. How would we coordinate that between the repos?