BUILD file not found in directory 'python' of external repository @com_google_protobuf
Referencing #139, I almost got pybind11_protobuf working in my repository, but I get the following error: BUILD:39:17: no such package '@com_google_protobuf//python': BUILD file not found in directory 'python' of external repository @com_google_protobuf. Add a BUILD file to a directory to mark it as a package. and referenced by '//mypath:my_ext.so'.
Is this to be expected in the current development state?
I think this has been a somewhat of a known issue for a while. Upstream protobuf maintainers have not committed to a stable Bazel interface for other projects to depend on as an external repository.
As a workaround, in my projects, I use a small patch to redirect Python to that defined my local toolchain. I can post an example when I'm back at the keyboard.
I'd be super grateful for an example! Thank you.
@jiawen Hi, just wanted to follow up on this
@jiawen Hi, just wanted to follow up on this
Sorry I should have given you a timeline. I'm still afk on vacation but will be back online in about a week.
Following up on this once more :)
Sorry I completely let this fall off my radar. Let me spend a few cycles today.
I put up a working end to end example here: https://github.com/jiawen/pybind_proto_example.
Try:
bazelisk test :line_utils_py_test --test_output=all
@laramiel @rickeylev @rwgk - I don't know how much interest there is in such an example. Or where it should live since it touches the whole stack. Maybe my personal repo isn't a terrible place :).
@alexeagle - IMHO this whole stack is barely held together by twine but seems to work well. Of note is this tiny but gross patch needed to make protobuf compile with Bazel and have Python find it.
Barely held together by twine is accurate. It's also churning more as the protobuf team has decided to deprecate rules_proto and move things into their repo.
@laramiel @rickeylev @rwgk - I don't know how much interest there is in such an example. Or where it should live since it touches the whole stack. Maybe my personal repo isn't a terrible place :).
FYI: I'm not a Googler anymore and will not work on this repo anymore.