-
Notifications
You must be signed in to change notification settings - Fork 51
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
CommonProtos is not compatible with Grpc 2.32 / protobuf 3.13 #420
Comments
Please could you clarify exactly what you're doing and what fails? While I would definitely expect to regenerate the code over time, if gRPC and/or Google.Protobuf have made changes that mean code generated against older versions is invalid, that's an issue that should be highlighted in the appropriate project. (Updating to a new version of Google.Protobuf or gRPC shouldn't require every dependency to be regenerated.) |
Grpc service proto:
Exception stack trace:
Worked well until upgrade to grpc 2.32. I think this issue relates to this features |
I was just adding a comment on the same gRPC issue. I've just validated that I can run existing tests for an "entirely old" package even when using Grpc.Core 2.32.0, so I suspect it's a matter of the gRPC 2.32.0 tooling expecting more than is available here. I'll change this from a bug to a feature request - I think gRPC should do more to address the compatibility here (as I don't think it's unreasonable to expect older library versions to still work) but there's no harm in regenerating. |
gRPC will work with older generated code, if the older generated code is the base message, e.g. Where it doesn't work is if you have generated a base message with newer tooling, but that messages use types generated with older tooling. For example CommonProtos needs to be regenerated. |
@JamesNK: "CommonProtos needs to be regenerated." And as I say, I'm happy to do that, but this feels like a significant backward compatibility issue that should have been considered more broadly. As an analogy, can you imagine the .NET team deciding "If you use .NET 5 tooling to compile a new console app that depends on a library, that library must have been built with .NET 5 as well"? There's no way that would be allowed to fly. This feels like "efficiency at any price, including breaking reasonable use cases". I hope more emphasis is put on backward compatibility in the future. |
Almost every scenario is supported: new base message + new nested message, old base + old nested, old base + new nested. The one scenario that doesn't automatically work out of the box is this one: new base + old nested. It was technically impossible. In this situation a user can work around it by setting the |
That "one scenario" has the potential to be a pretty common one though - and exactly the same could have been said about my example with .NET tooling. I think this would have been better as opt in rather than opt out. I'll try to get to regenerating this today, but of course this isn't the only library that could be affected by this :( |
I've now published Google.Api.CommonProtos 2.2.0, generated with Google.Protobuf.Tools 3.13.0 |
CommonProtos 2.1.0
Grpc/Grpc.Tools 2.32.0
.net core 3.1.8
Google.Protobuf.InvalidProtocolBufferException: Message Money doesn't provide the generated method that enables WriteContext-based serialization. You might need to regenerate the generated protobuf code.
The text was updated successfully, but these errors were encountered: