From 491d27e4e65417e16501b4dc2ebe74d8567a8d5a Mon Sep 17 00:00:00 2001 From: deannagarcia <69992229+deannagarcia@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:33:10 -0800 Subject: [PATCH 1/3] Add plugin.proto to the list of well known files for python In 21.x, depending on "//python:well_known_types_py_pb2" provided a transitive dependency to `compiler/plugin.proto`. That dependency was incorrectly removed for 22.x. --- python/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/python/BUILD.bazel b/python/BUILD.bazel index e67422b4ac..5fcece7f04 100644 --- a/python/BUILD.bazel +++ b/python/BUILD.bazel @@ -54,6 +54,7 @@ internal_py_proto_library( internal_copy_files( name = "copied_wkt_proto_files", srcs = [ + "//:compiler_plugin_proto", "//:well_known_type_protos", "//src/google/protobuf:descriptor_proto_srcs", ], From 56c149863c812b50f05cf23b5b25da0a465e587d Mon Sep 17 00:00:00 2001 From: deannagarcia <69992229+deannagarcia@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:43:21 -0800 Subject: [PATCH 2/3] Depend on proto file instead of proto library --- python/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/BUILD.bazel b/python/BUILD.bazel index 5fcece7f04..f6fe071152 100644 --- a/python/BUILD.bazel +++ b/python/BUILD.bazel @@ -54,9 +54,9 @@ internal_py_proto_library( internal_copy_files( name = "copied_wkt_proto_files", srcs = [ - "//:compiler_plugin_proto", "//:well_known_type_protos", "//src/google/protobuf:descriptor_proto_srcs", + "//src/google/protobuf/compiler:plugin.proto", ], strip_prefix = "src", ) From 620d21a8ac8ba9b00f4519df6af28f09d184ac3e Mon Sep 17 00:00:00 2001 From: deannagarcia <69992229+deannagarcia@users.noreply.github.com> Date: Fri, 17 Feb 2023 14:07:32 -0800 Subject: [PATCH 3/3] Add visibility of plugin.proto to python directory --- src/google/protobuf/compiler/BUILD.bazel | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel index cfbf714870..a0f3e84ef6 100644 --- a/src/google/protobuf/compiler/BUILD.bazel +++ b/src/google/protobuf/compiler/BUILD.bazel @@ -207,7 +207,10 @@ filegroup( exports_files( srcs = ["plugin.proto"], - visibility = ["//:__pkg__"], + visibility = [ + "//:__pkg__", + "//python:__pkg__", + ], ) cc_library(