-
Notifications
You must be signed in to change notification settings - Fork 36
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
Create a release package to enable adding pybind11_protobuf to Bazel Central Registry #139
Comments
As a follow-up, please note that copy-pasting the deps exactly as listed in the WORKSPACE in this repo, to my own client repo, generates a big list of errors along these lines:
|
Trying to help, but note that I don't actually use this externally myself, and this repo just has "best effort" support (IOW people's spare time).
Sounds like the way to go.
I don't see Really just guessing: Do you see this somewhere in your sources (and error messages)?
Maybe try Or probably better, add to your WORKSPACE:
|
Ok, it looks like these issues are fixed by: #149 The client repo simply needs to add the following to WORKSPACE (note reference to temp branch prior to code review):
and then add this dep to the pybind_extension rule: |
Hi! I'm working on cleaning up this repo and want to make progress on this as well. I'll work on getting this in soon. |
Great! It looks like a release package will need to be published also, so that we can start to add it to https://registry.bazel.build/ |
Yup! I just added MODULE.bazel, but as of now it's not fully ready since some packages in the BCR are pretty out of date, leading to out-of-sync versions and/or http_archive rules in the MODULE file. Abseil-py's 2.x update to the BCR is being discussed here:abseil/abseil-py#263, and Protobuf's is being discussed here: protocolbuffers/protobuf#14564. |
Hi, I'm using a mix of modules and WORKSPACE because some dependencies still don't have modules available in the BCR. However the bazel module name for abseil is How do people usually set up pybind11_protobuf in bazel? Is it only easily possible in fully WORKSPACE-based projects? |
@eguiraud you can use FYI I am also working on adding it to BCR: bazelbuild/bazel-central-registry#2074 Note that as the release process doesn't create any tags (and it is not planned to change this), I think we are better of in just using a version based on date and commit hash such that we can upload to BCR as needed. Otherwise future updates would be blocked on some maintainer manually creating a tag which does not follow any QA or compatibility tests anyways. |
@eguiraud I have for example this which works: In
In
|
Hi, thank you both for your quick replies! repo_mapping in the pybind11_protobuf WORKSPACE entryI tried adding a
(same for other dependencies of pybind11_protobuf that I bring in as modules) repo_name in the abseil-cpp MODULE entryThat seems to also do the job but it also requires changing pybind11_protobuf in the bazel central registryI saw it was just merged, this is the simplest solution. Thank you for pushing for it @mering ! I have a lot of new fun issues with dependency version mismatches between rules_python, protobuf and pybind11_protobuf but that's a whole new, fresh can of worms :) |
@eguiraud I am working on upgrading |
Thank you @mering ! I ran out of time to try and figure this out now, I got stuck at a problem with pybind11_bazel building the module for python 3.11 instead of the desired 3.10, like here: pybind/pybind11_bazel#82. I'm mentioning it here because somehow it only happens when I add pybind11_protobuf into the mix -- we have been using pybind11_bazel without pybind11_protobuf for a while and it works fine (no python version mismatches). For now I'm pivoting to writing the pybind11 bindings just for the couple of things I actually need by hand, but I'll try pybind11_protobuf again when the bazel protobuf module will pick up a more recent |
Hi,
Could you please add a complete set of instructions on how to include and use with Bazel?
I added the following stanza to my WORKSPACE file:
However, I cannot get the requirement for a com_google_protobuf dependency to work.
I believe the current practice would be to add this dep to MODULE.bazel:
https://registry.bazel.build/modules/protobuf/21.7
and then add this to the BUILD rule:
"@protobuf//:protos_python",
This however gives me this error:
no such package '@com_google_protobuf//': The repository '@com_google_protobuf' could not be resolved: Repository '@com_google_protobuf' is not defined and referenced by '@pybind11_protobuf//:native_proto_caster'
What's the correct way to get this to work?
(for future compatibility, I have filed a BCR request here bazelbuild/bazel-central-registry#1121 )
The text was updated successfully, but these errors were encountered: