-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
Any objection to add a ignore_go_package option in go_proto_library rule? #323
Comments
Long-term: we should fix go_proto_library. But that might take some effort. So short-term I would be ok with this hack if you want to write it. |
@rosun82 Would this work for you: write a genrule that removes |
I have tried that. The trouble is there are proto imports. A genrule has to produce a file with different name, say we rename file a.proto to a_fix.proto through genrule. If b.proto imports a.proto, it will not build |
Once the option is on, we will first strip the option go_package = ... line from the .proto file then compile, which avoids the problem where the compiled .pb.go file is in the directory unexpected by bazel. This partially resolves #323.
Background:
We have a bunch of protos put in a git repository, and for historical reasons they have go_package option specified. However, when switching to Bazel, the go_package option gets in the way, as the output .pb.go file is in the wrong place and wrong package hence cannot be used as "deps" for other go_proto_library rules.
Proposal, add an ignore_go_package option, when specified, simply remove "option go_package" line from the proto source code then compile.
I can handle the modification if there is no objection.
The text was updated successfully, but these errors were encountered: