-
-
Notifications
You must be signed in to change notification settings - Fork 699
Fail when expected files are not produced by protoc #4287
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
Conversation
rules_go upgraded org_golang_google_grpc_cmd_protoc_gen_go_grpc which triggered a version bump on the rest of GCP SDK. Because of bazel-contrib/rules_go#4287, trim unused go proto compilers in proto/BUILD targets.
This is a bit too strict. We have several use cases where a proto_library target would contain both message and service proto files inside OR, a gazelle-generated BUILD like this in one of our dependencies
|
We encountered the same problem, so what should we do now? downgrage rules_go version seem likes a bad idea |
We should revert this PR |
…ntrib#4287)" This reverts commit 077f15f.
…ntrib#4287)" This reverts commit 077f15f.
…4324) **What type of PR is this?** Bug fix **What does this PR do? Why is it needed?** It's common for a `go_proto_library` to include proto files with and without service definitions at the same time. In this case, the gRPC plugins are needed, but some gRPC plugins don't generate the grpc.pb.go files if there is no service definition. Partially reverting #4287 to restore the previous behavior of creating an empty file **Which issues(s) does this PR fix?** Fixes #4317 **Other notes for review** --------- Co-authored-by: Fabian Meumertzheim <[email protected]>
…4324) **What type of PR is this?** Bug fix **What does this PR do? Why is it needed?** It's common for a `go_proto_library` to include proto files with and without service definitions at the same time. In this case, the gRPC plugins are needed, but some gRPC plugins don't generate the grpc.pb.go files if there is no service definition. Partially reverting #4287 to restore the previous behavior of creating an empty file **Which issues(s) does this PR fix?** Fixes #4317 **Other notes for review** --------- Co-authored-by: Fabian Meumertzheim <[email protected]>
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
This PR fail the action if a plugin does not produce a valid Go file that it is supposed to produce. This disallows people to add gRPC plugin to a
go_proto_library
target that has no service definition, but avoids the cache poisoning due to bugs in proto plugins. Because Gazelle is able to switch between proto and grpc plugins depending on the existence of service definition, existing repos managed by Gazelle will not be affected.Which issues(s) does this PR fix?
Fixes #3949
Other notes for review
Credits to @r-hang for coming up with the patch