bazel: Migrate py_proto_library to @com_github_grpc_grpc#30834
Merged
yanavlasov merged 1 commit intoenvoyproxy:mainfrom Nov 16, 2023
Merged
bazel: Migrate py_proto_library to @com_github_grpc_grpc#30834yanavlasov merged 1 commit intoenvoyproxy:mainfrom
@com_github_grpc_grpc#30834yanavlasov merged 1 commit intoenvoyproxy:mainfrom
Conversation
|
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to |
5ddc33d to
9c3a8d4
Compare
9c3a8d4 to
81ee685
Compare
Signed-off-by: Sergii Tkachenko <sergiitk@google.com>
81ee685 to
ea7d1c2
Compare
sergiitk
commented
Nov 15, 2023
Comment on lines
+42
to
+43
| version = "83c031ea693357fdf7a7fea9a68a785d97864a38", | ||
| sha256 = "35bdcdbcd2e437058ad1f74a91b49525339b028a6b52760ab019fd9efa5a6d44", |
Contributor
Author
There was a problem hiding this comment.
Note: this will be updated once cncf/xds#74 is merged.
Contributor
Author
|
This is ready for a review now. |
yanavlasov
approved these changes
Nov 16, 2023
htuch
pushed a commit
to cncf/xds
that referenced
this pull request
Nov 16, 2023
py_proto_library provided by @com_google_protobuf//:protobuf.bzl has been deprecated for a while now: This is provided for backwards compatibility only. Bazel 5.3 will introduce support for py_proto_library, which should be used instead. https://github.com/protocolbuffers/protobuf/blob/32af7d211b85f71920acdfa9b796db008f8c2a45/protobuf.bzl#L642-L644 However, native py_proto_library has never been provided, see bazelbuild/bazel#3935. Instead @rules_python//python:proto.bzl is 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 using cc_proto_library to generate python targets, but downstream integration into Envoy failed (envoyproxy/envoy#30159). This PR migrates py_proto_library implementation 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: No more custom @com_google_googleapis dependency mapping needed via py_proto_library rules override. No more hardcoded dependencies _xds_py_proto_library - proto dependency tree is determined from proto_library definitions via Basel aspects. No more EXTERNAL_PROTO_PY_BAZEL_DEP_MAP dependency map needed - for the same reason. Similar work in Envoy: envoyproxy/envoy#30834. Signed-off-by: Sergii Tkachenko <sergiitk@google.com>
Contributor
Author
|
Hey @yanavlasov - we needed to merge cncf/xds first: #30834 (comment). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 cncf/xds#69. I found a hacky workaround by usingcc_proto_libraryto generate python targets, but downstream integration into Envoy failed (#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.Related PR in cncf/xds: cncf/xds#74.
Commit Message:
Additional Description:
Risk Level: Low
Testing: do_ci.sh
Docs Changes: no
Release Notes: no