Upgrade to Protobuf v4.25.6 and Implement Custom Proto Build Rules#238
Open
czgdp1807 wants to merge 7 commits intogoogle:masterfrom
Open
Upgrade to Protobuf v4.25.6 and Implement Custom Proto Build Rules#238czgdp1807 wants to merge 7 commits intogoogle:masterfrom
czgdp1807 wants to merge 7 commits intogoogle:masterfrom
Conversation
Updates core dependencies to support newer features and bug fixes.
Adds --noenable_bzlmod flag to work around protobuf v4.25.6 bzlmod issues.
- Add ProtoDescriptorInfo provider for proto descriptor files - Implement custom _py_proto_library_impl to handle proto compilation - Add proto_descriptor helper rule - Support gRPC plugin for service generation - Handle _virtual_imports paths from dependencies This replaces the deprecated protobuf.bzl rules with custom implementations compatible with protobuf v4.
Changes proto library references from _pb2.py to _py_pb2 format to align with protobuf v4 naming conventions.
Ensures CMake compatibility by explicitly setting minimum policy version.
- Replace cc_wkt_protos with explicit proto targets (any_proto, struct_proto, descriptor_proto, field_mask_proto) - Add missing protobuf dependency to record_parsing_utils - Bump Bazel version from 6.1.0 to 6.5.0 in Dockerfile These changes ensure compatibility with protobuf v4.25.6's new dependency structure.
20ce886 to
056509b
Compare
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.
Summary
This PR upgrades ML Metadata to Protobuf v4.25.6 and gRPC v1.62.1, implementing custom Bazel proto library rules to replace deprecated
protobuf.bzlmacros. This modernizes the build system and ensures compatibility with the latest protobuf releases.Changes Overview
1. Dependency Upgrades
Files:
WORKSPACE,.bazelrc,ml_metadata/tools/docker_server/Dockerfile2. Custom Proto Library Implementation
_py_proto_library_ruleandcc_proto_librarywrapper to replace deprecated@com_google_protobuf//:protobuf.bzlrulesProtoDescriptorInfoprovider for proto dependency managementuse_grpc_pluginparameter_virtual_importspaths and transitive proto dependencies_pb2.pysuffix to_py_pb2formatFiles:
ml_metadata/ml_metadata.bzl,ml_metadata/BUILD3. Proto Dependency Updates
cc_wkt_protoswith explicit well-known type dependencies:any_proto,struct_proto,descriptor_proto,field_mask_proto@com_google_protobuf//:protobufdependency torecord_parsing_utilsFiles:
ml_metadata/proto/BUILD,ml_metadata/util/BUILD4. Build Fixes
CMAKE_POLICY_VERSION_MINIMUM=3.5to MySQL client build for CMake compatibilityFiles:
ml_metadata/libmysqlclient.BUILDBackward Compatibility
All changes maintain API compatibility. Proto compilation outputs remain functionally identical, with only build system implementation differences.