I have isolated Heron's Protobuf in this repository: https://github.com/surahman/Heron-Protobuf. The objective is to build Heron's protocol buffer in isolation to verify it builds correctly, and for faster and easier debugging. I am currently facing an issue where imports within the .proto files cannot be resolved. I have tried to place all the files in a flat directory structure and to use the import_prefix here https://docs.bazel.build/versions/main/be/protocol-buffer.html
I have also forked an example Bazel protobuf repo and made adjustments for py_proto_library: https://github.com/surahman/Proto-Library-Example This work is based on the following tutorial: https://thethoughtfulkoala.com/posts/2020/05/08/py-protobuf-bazel.html The Java and CXX libraries build successfully but the Python library build is resulting in the following error: Proto-Library-Example/src/BUILD:37:17: in deps attribute of py_library rule //src:person_py_proto: '//src:person_proto' does not have mandatory providers: 'py' or 'PyInfo'. Since this rule was created by the macro 'py_proto_library', the error might have been caused by the macro implementation Help and advice are greatly appreciated. There is limited support in Bazel for native Python rules ( https://docs.bazel.build/versions/main/be/overview.html#rules) and there is not a whole lot of information I could lookup through web searches. On Fri, Jan 28, 2022 at 6:00 PM Saad Ur Rahman <saadurrah...@apache.org> wrote: > Hello everyone, > > A quick update on the Native Python build rule migration: > https://github.com/apache/incubator-heron/pull/3768 > > A transition to importing and building protobuf is required to proceed > here: heron/proto/proto-py. Help/advice from anyone with experience > building/using protobuf in Bazel would be greatly appreciated. Transition > details are in the article below but I am new to Bazel and protobuf in > Python: > https://thethoughtfulkoala.com/posts/2020/05/08/py-protobuf-bazel.html > >