grpc / grpc/grpc-rust

`protobuf` v4 codec and codegen

Open
#2,206 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
12.5k
Forks
1.3k
Avg merge
4d 7h
Merged PRs (30d)
24

Description

## Feature Request

Add `protobuf` v4 server code generation and server codec support.

### Motivation

A beta version of the Google-assumed `protobuf` library seems to have been [released](https://groups.google.com/g/protobuf/c/G3DZIvytU0o/m/cSStRxfgAQAJ) ([4.30.0-beta1](https://docs.rs/protobuf/4.30.0-beta1/protobuf)). Assuming this will eventually provide semi-official Proto Text and JSON serialization support. See [docs](https://protobuf.dev/reference/rust/).

Given that the `protobuf` library wraps the C++ implementations, I'd lean towards assuming that any new gRPC Rust implementation will also wrap the C++ server given the battle-tested C++ proto messages stated reasonings. Or maybe it would be pure Rust, but based on another runtime like [Cloudflare's Pingora](https://github.com/cloudflare/pingora). In any case, developers may wish to stick with `tonic`/`hyper`/`tokio`, but replace `prost`.

### Caveats

- Message generation will probably not be done under the `prost` project?
- Have not tried to compile the protos myself personally (Ubuntu 22.04.5 LTS, x86_64):

```shell
$ sha256sum ~/tmp/bin/protoc
1736d7bdcf94a2d96ed355c329b603f067dc70b3b7306431cedf5a3e5f2b91d8 /home/kris/tmp/bin/protoc
$ ~/tmp/bin/protoc --version
libprotoc 30.0
$ ~/tmp/bin/protoc --rust_out=./rust_out \
--rust_opt=experimental-codegen=enabled \
--rust_opt=kernel=cpp \
-Iprotos protos/google/protobuf/source_context.proto
$ tree rust_out/
rust_out/
└── google
└── protobuf
├── generated.rs
├── source_context.c.pb.rs
└── source_context.pb.thunks.cc

3 directories, 3 files
```

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.