-
Notifications
You must be signed in to change notification settings - Fork 88
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
build(proto): replace buf-generate by tonic_build #581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The *.tonic.rs
files have been absorbed as modules directly into their parent files (these were include!
ed previously I believe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! so are we still using buf for handling dependencies, but tonic for the actual build?
Yeah, so My understanding is that tonic-build would usually invoke protoc, which would also result in that file descriptor set. But we This way we avoid having to vendor tendermint. |
Summary
Replaces
buf generate
bytonic_build
to generate rust code from protobuf.Background
buf generate
relies on the third party pluginsprotoc-gen-prost
andprotoc-gen-tonic
, which are not yet updated to prost-build 0.12 and tonic-build 0.10 (and hence prost 0.12, tonic 0.10).This patch moves code generation away from the
buf generate
executable to the Rusttonic-build
crate, because we need to update prost/tonic and because these projects do not guarantee that code generated with older versions work with newer versions.Changes
buf generate
executable by usingtonic_build
directlybuf build
to create a file descriptor set that can be fed intotonic_build
(the latter skips its own invocation ofprotoc
)astria.
(tonic also creates client and server code for tendermint abci; I am not sure why, probably due to the descriptor set)Testing
Not tested directly; this should not affect the actual code generated. Everything should still compile, all tests should pass.
Related Issues
PR requiring a newer version of penumbra and hence prost: #579
PR againast protoc-gen-prost: neoeinstein/protoc-gen-prost#78