grpc / grpc/grpc-java

Update to Protobuf 4.x

Offen
#11,015 38 Kommentare 42 Reaktionen 1 zugewiesene Person Beansprucht von @ejona86 Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Java
Sterne
12.1k
Forks
4k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
37

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.