grpc / grpc/grpc-java

Update to Protobuf 4.x

Open
#11,015 38 comments 42 reactions 1 assignee Claimed by @ejona86 View on GitHub
enhancement
Dominant language
Java
Stars
12.1k
Forks
4k
Avg merge
2d 17h
Merged PRs (30d)
37

Description

Edit by @ejona86: Protobuf has resolved the incompatibility with protobuf-java 4.x. For current status, see my two comments starting at https://github.com/grpc/grpc-java/issues/11015#issuecomment-2470827638

Edit by @ejona86: Protobuf 4.33 supports all 3.x generated code, so most things preventing people from upgrading should be resolved. Even though it supports 3.x generated code, that is just to make it easier for you to upgrade to the newer codegen; 5.x will probably still be dropping 3.x codegen support. https://github.com/grpc/grpc-java/issues/11015#issuecomment-3423523590

---------

### Is your feature request related to a problem?

I would like to use the latest released version of Protobuf (4.26.0) but I cannot as gRPC is still using the old version.

### Describe the solution you'd like

Update Protobuf dependency and make it work with the new version.

### Describe alternatives you've considered

I hoped that the update would be easy (just a version bump) so I tried doing it myself but it resulted in a compilation failure so I'll leave it to you to figure it out.

The failure:

```
> Task :grpc-protobuf:compileJava FAILED
grpc-java/protobuf/src/main/java/io/grpc/protobuf/StatusProto.java:38: error: cannot access GeneratedMessageV3
ProtoLiteUtils.metadataMarshaller(com.google.rpc.Status.getDefaultInstance()));
^
class file for com.google.protobuf.GeneratedMessageV3 not found
grpc-java/protobuf/src/main/java/io/grpc/protobuf/StatusProto.java:171: error: cannot access Builder
.setCode(status.getCode().value());
^
class file for com.google.protobuf.GeneratedMessageV3$Builder not found
2 errors
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.