Skip to content

Add grpc-rust documentation: language landing page, quickstart, and route guide (#1511)#1517

Merged
dfawley merged 10 commits into
grpc:mainfrom
dfawley:rbrb
May 28, 2026
Merged

Add grpc-rust documentation: language landing page, quickstart, and route guide (#1511)#1517
dfawley merged 10 commits into
grpc:mainfrom
dfawley:rbrb

Conversation

@dfawley
Copy link
Copy Markdown
Member

@dfawley dfawley commented May 22, 2026

This is identical to #1511, rolled back in #1516 since we don't want it live yet.

@dfawley dfawley requested a review from ejona86 May 22, 2026 14:58
Copy link
Copy Markdown
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems you should have more PR description about when you do want this to go in.

the repo:

```sh
git clone -b {{< param grpc_vers.rust >}} --depth 1 https://github.com/grpc/grpc-rust
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command clones the v0.9.0 tag used for a three year old tonic release. We should use a gRPC specific tag instead.

git clone -b v0.9.0 --depth 1 https://github.com/grpc/grpc-rust

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, yes I didn't think of that. I'll go with grpc-v0.9.0

Comment on lines +14 to +27
- **[Protocol buffer][pb] compiler**, `protoc`, [version 34.0][proto34].

For installation instructions, see [Protocol Buffer Compiler
Installation][pbc-install]. Note that because Rust support in `protoc` is not
yet stable, the version installed must be exactly 34.0.

- **gRPC-Rust plugin** for the protocol compiler:

1. A C++17 compatible compiler and CMake 3.14 or higher are required to
compile the protobuf code generation tool.
2. Follow the detailed instructions on the [`protoc-gen-rust-grpc`][pgrg] page
to compile and install the plugin.
3. Be sure to update your `PATH` so that the `protoc` compiler can find the
plugin.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the changes in grpc/grpc-rust#2654, users no longer need to manually install protoc or the protoc-gen-rust-grpc plugin and add them to their PATH. Instead, they can simply use the --features grpc-protobuf-build/build-plugin flag to compile them from source. Alternatively, users can edit the Cargo.toml to enable the grpc-protobuf-build/build-plugin feature.

cargo run --bin helloworld-server --features grpc-protobuf-build/build-plugin

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks!

Comment on lines +126 to +130
```sh
protoc --rust_out=src/grpc-helloworld/generated/ --rust_opt=experimental-codegen=enabled,kernel=upb \
--rust-grpc_out=src/grpc-helloworld/generated/ --rust-grpc_opt=client_only=true \
--proto_path=proto/helloworld/ proto/helloworld/helloworld.proto
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're now using build.rs to generate the code, we can simply run the following:

cargo build --bin grpc-helloworld-client

or

cargo build --bin grpc-helloworld-client --features grpc-protobuf-build/build-plugin

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +148 to +154
```sh
protoc \
--rust_out=src/grpc-routeguide/generated/ --rust_opt=experimental-codegen=enabled,kernel=upb \
--rust-grpc_out=src/grpc-routeguide/generated/ --rust-grpc_opt=client_only=true \
--proto_path=proto/routeguide/ \
proto/routeguide/route_guide.proto
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be replaced with a cargo build now.

cargo build --bin grpc-routeguide-client

We should also explain the addition of grpc_protobuf_build::CodeGen call the build.rs file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment on lines +37 to +39
changes are made to your proto definitions. However, it requires anyone who
wants to compile your crate to have `protoc` installed, and the proper C++
requirements for building the `protoc-gen-rust-grpc` binary.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the changes from grpc/grpc-rust#2654, the default behaviour is to compile protoc and the plugin from source. This sentence needs to be updated.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Copy link
Copy Markdown
Member Author

@dfawley dfawley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated; thank you for the review

the repo:

```sh
git clone -b {{< param grpc_vers.rust >}} --depth 1 https://github.com/grpc/grpc-rust
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, yes I didn't think of that. I'll go with grpc-v0.9.0

Comment on lines +14 to +27
- **[Protocol buffer][pb] compiler**, `protoc`, [version 34.0][proto34].

For installation instructions, see [Protocol Buffer Compiler
Installation][pbc-install]. Note that because Rust support in `protoc` is not
yet stable, the version installed must be exactly 34.0.

- **gRPC-Rust plugin** for the protocol compiler:

1. A C++17 compatible compiler and CMake 3.14 or higher are required to
compile the protobuf code generation tool.
2. Follow the detailed instructions on the [`protoc-gen-rust-grpc`][pgrg] page
to compile and install the plugin.
3. Be sure to update your `PATH` so that the `protoc` compiler can find the
plugin.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks!

Comment on lines +148 to +154
```sh
protoc \
--rust_out=src/grpc-routeguide/generated/ --rust_opt=experimental-codegen=enabled,kernel=upb \
--rust-grpc_out=src/grpc-routeguide/generated/ --rust-grpc_opt=client_only=true \
--proto_path=proto/routeguide/ \
proto/routeguide/route_guide.proto
```
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment on lines +37 to +39
changes are made to your proto definitions. However, it requires anyone who
wants to compile your crate to have `protoc` installed, and the proper C++
requirements for building the `protoc-gen-rust-grpc` binary.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Comment on lines +126 to +130
```sh
protoc --rust_out=src/grpc-helloworld/generated/ --rust_opt=experimental-codegen=enabled,kernel=upb \
--rust-grpc_out=src/grpc-helloworld/generated/ --rust-grpc_opt=client_only=true \
--proto_path=proto/helloworld/ proto/helloworld/helloworld.proto
```
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dfawley dfawley merged commit 5cfba73 into grpc:main May 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants