Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILD file not found in directory 'python' of external repository @com_google_protobuf #164

Open
translunar opened this issue Jun 18, 2024 · 11 comments

Comments

@translunar
Copy link

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?

@jiawen
Copy link

jiawen commented Jun 19, 2024

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.

@translunar
Copy link
Author

I'd be super grateful for an example! Thank you.

@translunar
Copy link
Author

@jiawen Hi, just wanted to follow up on this

@jiawen
Copy link

jiawen commented Jul 1, 2024

@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.

@translunar
Copy link
Author

Following up on this once more :)

@jiawen
Copy link

jiawen commented Sep 10, 2024

Sorry I completely let this fall off my radar. Let me spend a few cycles today.

@jiawen
Copy link

jiawen commented Sep 11, 2024

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

@jiawen
Copy link

jiawen commented Sep 11, 2024

@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 :).

@jiawen
Copy link

jiawen commented Sep 11, 2024

@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.

@alexeagle
Copy link

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.

@rwgk
Copy link
Contributor

rwgk commented Sep 12, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants