-
Notifications
You must be signed in to change notification settings - Fork 78
bazel: Migrate py_proto_library to @com_github_grpc_grpc
#74
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
Signed-off-by: Sergii Tkachenko <[email protected]>
Signed-off-by: Sergii Tkachenko <[email protected]>
83c031e to
8751dcc
Compare
|
@adisuissa @kyessenov this is ready for review. |
|
Overall I like this approach a lot. @phlax @moderation are there any concerns here about taking the dependency from https://github.com/grpc/grpc? It's already a build dependency, and these are Bazel rules, so we should still be able to compile Envoy without linking Google gRPC, but just wanted to check. |
|
overall looks fine, and appears address a number of issues - not sure iiuc re grpc dep, but from what i do seems ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, thanks for fixing this!
Will it be possible to have the same change in https://github.com/envoyproxy/envoy/tree/main/api/bazel ?
|
@adisuissa yes - I have a PR in progress: envoyproxy/envoy#30834. |
|
LGTM |
|
Looks like to make it work nicely in Envoy, we'd have to merge this first. Otherwise, bazel complains about missing
It might be possible to solve this in Envoy without merging this, but it'd be a throw-away work. Let's get this one in first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
Seems that the dependency shepherds are ok with the protoc dependency, so I'm going to approve this PR.
LGTM!
|
@sergiitk thanks for this example - but per https://groups.google.com/g/grpc-io/c/44OcoVSmeQk?pli=1 it seems like this is using something deprecated. I'd appreciate any pointers to an "officially recommended" way to generate service stubs with Bazel, on behalf of a lot of the community looking for it. |
py_proto_libraryprovided by@com_google_protobuf//:protobuf.bzlhas been deprecated for a while now:However, native
py_proto_libraryhas never been provided, see bazelbuild/bazel#3935. Instead@rules_python//python:proto.bzlis recommended. I attempted switching to this library, but it's not compatible with@com_google_googleapis's py_proto_library targets, see #69. I found a hacky workaround by usingcc_proto_libraryto generate python targets, but downstream integration into Envoy failed (envoyproxy/envoy#30159).This PR migrates
py_proto_libraryimplementation to to@com_github_grpc_grpc. This implementation is used by@com_google_googleapis's, and, more importantly, uses bazel aspects. Which decouples cncf/xds and Envoy's dependencies from concrete upstream py_proto_library implementations.This resulted in a significant code improvement of
bazel/api_build_system.bzl:@com_google_googleapisdependency mapping needed viapy_proto_libraryrules override._xds_py_proto_library- proto dependency tree is determined fromproto_librarydefinitions via Basel aspects.EXTERNAL_PROTO_PY_BAZEL_DEP_MAPdependency map needed - for the same reason.Similar work in Envoy: envoyproxy/envoy#30834.