grpc / grpc/grpc-rust

prost_build::Config should be re-exported in tonic_build

Open
#1,944 0 comments 3 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

### Crates
tonic-build

### Motivation
[tonic_build::Builder::compile_with_config](https://docs.rs/tonic-build/latest/tonic_build/struct.Builder.html#method.compile_with_config)
takes a [prost_build::Config](https://docs.rs/prost-build/0.13.1/prost_build/struct.Config.html) as an argument, which requires the additional dependency of prost-build.

Since tonic_build already [re-exports prost::{compile_fds, compile_protos, configure, Builder}](https://github.com/hyperium/tonic/blob/43c926fd90adc638990ed456bb83ecc822cfb75a/tonic-build/src/lib.rs#L86), I think this compile_with_config should be callable without prost-build as a separate dependency

(I need to use compile_with_config, so that I can `enable_type_names`.)

### Proposal
I propose we additionally re-export [prost_build::Config](https://docs.rs/prost-build/0.13.1/prost_build/struct.Config.html) and update the documentation [here](https://docs.rs/tonic-build/latest/tonic_build/index.html#:~:text=%3B%0A%20%20%20%20Ok(())%0A%7D-,Configuration,-fn%20main()%20%2D%3E) to include an example of using `compile_with_config`.

I'll be happy to create the PR, but first want to get feedback.

### Alternatives
¯\_(ツ)_/¯

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.