Skip to content

Conversation

LarsSven
Copy link
Contributor

@LarsSven LarsSven commented May 28, 2025

Quarkus 3.21 added support for the Kotlin extension of Java gRPC. With this support however, protobuf-kotlin was given a protobuf V4 version. The Java protobuf version published by Quarkus is however a protobuf V3 version. V4 has a breaking change around a class rename of GeneratedMessageV3 to GeneratedMessage, which is one of the reasons Quarkus is still on V3.

Publishing a V4 version of Kotlin but a V3 version of Java causes incompatibility exactly due to this breaking change. So the project I work on which is using Quarkus is getting the following error:

Reason:
  Type 'com/google/protobuf/GeneratedMessageV3$FieldAccessorTable' (current frame, stack[0]) is not assignable to 'com/google/protobuf/GeneratedMessage$FieldAccessorTable' (from method signature)

This is fixed by giving protobuf-kotlin a V3 version. I think it makes sense for both Java and Kotlin to always be synced up, so I simply change the hardcoded protobuf-kotlin version to the protoc version that Java is using too, which changes Kotlin to a V3 version.

Note that theoretically, the versions of different languages of protobuf may diverge. While the minor and patch version will always be the same, the major version may change if one language has a breaking change but another does not. So theoretically Kotlin may at some point get a version like 6.80.1 while Java would be 7.80.1, however, I would say this is unlikely since Kotlin extends the Java implementation, whereas something like C# and Java diverting I would say would be an actual possibility.

Copy link

quarkus-bot bot commented May 28, 2025

Thanks for your pull request!

Your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@LarsSven LarsSven changed the title Sync Kotlin protobuf version with Java protobuf version Sync Kotlin protobuf version with Java protobuf version May 28, 2025
@LarsSven
Copy link
Contributor Author

Thanks for your pull request!

Your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

Had a space in front of the title accidentally, I removed the space

@gsmet
Copy link
Member

gsmet commented May 28, 2025

Thanks! This seems to makes sense to me but we probably need to document it in the migration guide.

Asked a proper review to @alesj and @cescoffier .

@gsmet gsmet force-pushed the ls/downgrade-kotlin-gprc branch from 6387c00 to 96cafa6 Compare May 29, 2025 08:53
@gsmet gsmet merged commit 9ba60eb into quarkusio:main May 30, 2025
55 of 56 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.24 - main milestone May 30, 2025
@gsmet gsmet modified the milestones: 3.24 - main, 3.23.1 Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants