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

How to integrate with protobuf 3.15.3? #75

Open
dongqixu opened this issue Jun 7, 2022 · 2 comments
Open

How to integrate with protobuf 3.15.3? #75

dongqixu opened this issue Jun 7, 2022 · 2 comments

Comments

@dongqixu
Copy link

dongqixu commented Jun 7, 2022

Thanks for the great work!

I was using protobuf 3.15.3 and encountered the following error message.
'const struct google::protobuf::python::PyProto_API' has no member named 'DescriptorPool_FromPool'

I checked https://github.com/protocolbuffers/protobuf/blob/v3.15.3/python/google/protobuf/proto_api.h and found there is no such an API in protobuf 3.15.3. Is is possible to integrate the project with the given version? Thanks.

@amauryfa
Copy link

amauryfa commented Jun 8, 2022

Indeed, this API has been added to version 3.18.0. You need this version of protobuf to compile pybind11_protobuf as is.

But, it appears that this call is only needed to support custom descriptor pools: usually, internal Python structures have not been set up in this case.
You could try removing the 5 lines around the call to DescriptorPool_FromPool. If your messages come from a standard pb2 module, this won't make a difference.

@rwgk
Copy link
Contributor

rwgk commented Jun 9, 2022

@dongqixu If you need to keep using versions prior to 3.18.0, could you please try out #ifdef around the 5 lines pointed out by @amauryfa and post the diff here? I'll apply that to our internal version, which then gets exported back here.

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

3 participants