Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Generate protos using a user defined prost_build::Config #317

Closed
SkamDart opened this issue Apr 1, 2020 · 6 comments
Closed

Feature: Generate protos using a user defined prost_build::Config #317

SkamDart opened this issue Apr 1, 2020 · 6 comments

Comments

@SkamDart
Copy link
Contributor

SkamDart commented Apr 1, 2020

Feature Request

Add the ability to compile protos using a user defined prost_build::Config.

Crates

tonic-build

Motivation

#314 beat me to opening a similar issue. I have a repro here for failing to compile google protobuf types.

prost provides the ability to compile_well_known_types to generate their well known types from the corresponding .proto files. However, the tonic-build crate uses the default constructor

Proposal

Add an additional function, compile_with_builder similar to tonic_build::compile that includes a parameter for a user defined prost_build::Config.

Alternatives

If we want to solve a subset of the problem, we could call the compile_well_known_types for all builds.

FWIW - I'm probably missing or some reason why you didn't do this originally.

@rlabrecque
Copy link

Hmm it used to?

#49

@LucioFranco
Copy link
Member

@SkamDart everything seems to compile fine if I include prost-types as a dependency? Is there a specific reason that doesn't work for you?

I do think we can include a way for users to manually use the prost config, I'll open a PR for that.

@LucioFranco
Copy link
Member

Ok Pr has been merged to support custom prost configs #318

@SkamDart
Copy link
Contributor Author

SkamDart commented Apr 1, 2020

@LucioFranco Incredible. Thank you very much! I was going to happily do the dev work myself but you beat me to it.

@SkamDart
Copy link
Contributor Author

SkamDart commented Apr 1, 2020

As for why it doesn't compile without that? It's likely that, I'm not including prost-types.

@LucioFranco
Copy link
Member

@SkamDart yup, if you look at the error it shoudl say its looking for prost-types but its not included in the cargo.toml.

@SkamDart SkamDart changed the title Feature: Genereate protos using a user defined prost_build::Config Feature: Generate protos using a user defined prost_build::Config Aug 23, 2020
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

No branches or pull requests

3 participants