Skip to content

Support --features protoc-gen-rust-grpc everywhere for protoc#2688

Open
ejona86 wants to merge 2 commits into
grpc:masterfrom
ejona86:protoc-gen-rust-grpc-for-tonic
Open

Support --features protoc-gen-rust-grpc everywhere for protoc#2688
ejona86 wants to merge 2 commits into
grpc:masterfrom
ejona86:protoc-gen-rust-grpc-for-tonic

Conversation

@ejona86

@ejona86 ejona86 commented Jun 15, 2026

Copy link
Copy Markdown
Member

grpc-protobuf-build had disabled the implicit feature by having a feature with dep:protoc-gen-rust-grpc, so I changed build-plugin to act as an alias and enable the now-implicit feature protoc-gen-rust-grpc.

Since interop/, grpc-protobuf-build/, and examples/ all use the protoc-gen-rust-grpc feature, you can now build everything at the top-level with just cargo build --features protoc-gen-rust-grpc without protoc on the PATH.

interop/ is nice in that enabling the protoc-gen-rust-grpc feature cascades to enable the feature on grpc-protobuf-build. Without that, doing cargo build -p interop --features protoc-gen-rust-grpc would still require protoc in the PATH. Note that examples doesn't have that, so GRPC_RUST_REGENERATE_PROTO=1 cargo build -p examples --features protoc-gen-rust-grpc requires protoc in PATH for the grpc codegen; it still requires --features grpc-protobuf-build/protoc-gen-rust-grpc. Since it is an example, keeping them separate seems the most straight-forward for users, at least for now.

CC @dfawley

ejona86 added 2 commits June 15, 2026 15:10
grpc-protobuf-build had disabled the implicit feature by having a
feature with dep:protoc-gen-rust-grpc, so I changed build-plugin to act
as an alias and enable the now-implicit feature protoc-gen-rust-grpc.

Since interop/, grpc-protobuf-build/, and examples/ all use the
protoc-gen-rust-grpc feature, you can now build everything at the
top-level with just `cargo build --features protoc-gen-rust-grpc`
without protoc on the PATH.

interop/ is nice in that enabling the protoc-gen-rust-grpc feature
cascades to enable the feature on grpc-protobuf-build. Without that,
doing `cargo build -p interop --features protoc-gen-rust-grpc` would
still require protoc in the PATH. Note that examples doesn't have that,
so `GRPC_RUST_REGENERATE_PROTO=1 cargo build -p examples --features
protoc-gen-rust-grpc` requires protoc in PATH for the grpc codegen; it
still requires --features grpc-protobuf-build/protoc-gen-rust-grpc.
Since it is an example, keeping them separate seems the most
straight-forward for users, at least for now.
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.

1 participant