-
Notifications
You must be signed in to change notification settings - Fork 610
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
Add support for Protobuf 5 #3958
Comments
The simplest solution is to only support a single protobuf major version. Once the ecosystem has majority moved over to Protobuf 5, we can switch over to just supporting it. I don't have a good signal on when that is. It would helpful if people can share what version of Protobuf you are using and if this is a critical blocker for other version upgrades. |
The new version of the authzed library already uses protobuf 5. And we are planning an update, but a dependency conflict is preventing us. Hope for a speedy resolution |
This may be interesting: |
Right, but can't the runtime be updated even if the generated files are old? e.g. the google cloud tools like pubsub allow anything from https://github.com/googleapis/python-pubsub/blob/main/setup.py#L45 Upon investigation, it turns out that they are using |
My understanding is that, until Q1 2025 when they launch rolling compatibility, it is not guaranteed to work:
It is only guaranteed to work across the same minor version:
|
We are using protobuf 5, and just started using OpenTelemetry. Our current workaround is to have our own version of opentelemetry-python that contains protobuf 5 generated files. Not ideal, but without that OpenTelemetry would be a non-starter for us for the time being. Yesterday though I encountered an interesting approach to this problem that might be a good solution for OpenTelemetry too. wandb generates pb2 files for all protobuf versions, then dynamically imports the appropriate one based on the protobuf runtime version, as shown in the link below: |
Thanks for the data point. It's been a few months now, I think we should just upgrade to protobuf 5. Let's try to get it in for the next release.
We have considered that as well, but since protobuf says they'll have rolling support in the next 6 months, I think we could just wait. Hopefully the next major version will be covered. |
Protobuf 5 was released but it currently conflicts with
opentelemetry-proto
packageopentelemetry-python/opentelemetry-proto/pyproject.toml
Lines 27 to 29 in 762bd8f
This is by design since protobuf generated code is supposed to match the runtime protobuf library version. When 4.x was released we had a lot of issues and I opened protocolbuffers/protobuf#11123 to get some clarification. We know have some docs https://protobuf.dev/support/cross-version-runtime-guarantee/ which make it clear New Gencode + Old Runtime = Never Allowed. I.e. regenerating code with grpcio-tools 5 will break compatibility with protobuf 4.
This puts us in a tricky spot of choosing which major version to support. The good news is
That doesn't help right now, but hopefully will for the next major version. Because they are planning to fix things, I'm hesitant on making our own solution like keeping two copies of generated code and dynamically choosing between them at import time.
Related
The text was updated successfully, but these errors were encountered: