grpc / grpc/grpc-java

Update to Protobuf 4.x

Aperta
#11,015 38 commenti 42 reazioni 1 assegnatario Rivendicata da @ejona86 Vedi su GitHub
enhancement
Lingua principale
Java
Stelle
12.1k
Fork
4k
Merge medio
2g 17h
PR unite (30g)
37

Descrizione

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
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.