You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the .pb.go files that get generated contain calls to methods in other generated files, but said methods don't actually exist.
To Reproduce
I'm afraid this is going to be a terrible bug report since I'm unable to share any of the files that I'm working with but we'll see. I'm not sure where this issue stems from and if the problem lies in grpc-gateway or elsewhere but here's an attempt at describing what happens.
I have a proto at path ~/dev/services/my-org/my-service/v1/my_service.proto. The proto package is package my-org.my-service.v1; and I've declared option go_package = "my-org.com/rest-proxy/my-service/v1"
The proto includes an import of another proto ("other.proto") which is located in the same folder as the service proto.
From inside ~/dev/services/my-org I execute the following commands for both protos:
In the generated my-service.pb.go there is now a function called file_v1_my_service_proto_init(), which contains what I assume is meant to be a call to the corresponding init function of other.pb.go. The problem is that this function has the wrong name.
If I look in the generated file for other.proto, its init function is called file_v1_other_proto_init. However, the function we're trying to call from my_proto.pb.go is called file_services_my_org_v1_other_proto_init. It thus seems to assume that the init function name is derived from the file path rather than anything else.
Expected behavior
I would expect consistent names to be used across the board.
Actual Behavior
Somewhere there is a disconnect between what things are actually called and what they are "expected" to be called.
Your Environment
grpc-gateway v2.0.0-beta.4
protoc v 3.12.2
As I said, no idea where the root of this issue is but if possible I would like some input on what's going on here.
Thanks!
The text was updated successfully, but these errors were encountered:
Sorry you're having some problems. I appreciate you taking the time to open an issue, but this is almost certainly down to some sort of generation environment misconfiguration. For starters, the init functions you're talking about are generated by protoc-gen-go and protoc-gen-go-grpc, which are not maintained in this repo (see https://github.com/protocolbuffers/protobuf-go/ and https://github.com/grpc/grpc-go respectively). I doubt there's anything we can do to fix it, but regardless I'd be happy to help you debug this in a more synchronous environment. Why don't you join the Gophers slack, we have a channel for #protobuf (and another for #grpc and #grpc-gateway) where we could work this out.
I'm going to close this as I believe it is unrelated to our repo. Hope to see you on Slack!
🐛 Bug Report
Some of the
.pb.go
files that get generated contain calls to methods in other generated files, but said methods don't actually exist.To Reproduce
I'm afraid this is going to be a terrible bug report since I'm unable to share any of the files that I'm working with but we'll see. I'm not sure where this issue stems from and if the problem lies in grpc-gateway or elsewhere but here's an attempt at describing what happens.
I have a proto at path
~/dev/services/my-org/my-service/v1/my_service.proto
. The proto package ispackage my-org.my-service.v1;
and I've declaredoption go_package = "my-org.com/rest-proxy/my-service/v1"
The proto includes an import of another proto ("other.proto") which is located in the same folder as the service proto.
From inside
~/dev/services/my-org
I execute the following commands for both protos:In the generated
my-service.pb.go
there is now a function calledfile_v1_my_service_proto_init()
, which contains what I assume is meant to be a call to the corresponding init function ofother.pb.go
. The problem is that this function has the wrong name.If I look in the generated file for
other.proto
, its init function is calledfile_v1_other_proto_init
. However, the function we're trying to call frommy_proto.pb.go
is calledfile_services_my_org_v1_other_proto_init
. It thus seems to assume that the init function name is derived from the file path rather than anything else.Expected behavior
I would expect consistent names to be used across the board.
Actual Behavior
Somewhere there is a disconnect between what things are actually called and what they are "expected" to be called.
Your Environment
grpc-gateway v2.0.0-beta.4
protoc v 3.12.2
As I said, no idea where the root of this issue is but if possible I would like some input on what's going on here.
Thanks!
The text was updated successfully, but these errors were encountered: