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

Expose generation methods for buf #598

Merged
merged 8 commits into from
Mar 18, 2022

Conversation

neoeinstein
Copy link
Contributor

This revives PR #313. With the advent of v1.0 of buf.build, the ecosystem for generating polyglot code from protobuf heavily favors the plugin model. It very easily slots into the buf generate model. This revival creates a distinct protoc-gen-prost crate to host the binary, rather than the prior method of putting the binary in the prost-build crate. This makes installation using cargo install protoc-gen-prost more convenient.

In my opinion, Prost would benefit from integrating into this model, so I wanted to revive the old protoc plugin. Even with this very basic PR (which doesn't handle options), I have confirmed that puting the binary onto the PATH and running buf generate results in precisely the Rust code I would expect over a somewhat complicated hierarchy of protobuf files.

@neoeinstein neoeinstein force-pushed the protoc-gen-prost branch 3 times, most recently from 5cfb922 to cfed201 Compare February 24, 2022 21:49
@neoeinstein
Copy link
Contributor Author

This has now been updated to an even smaller, minimum viable set of changes to support an external plugin executable. I've create that executable now at https://github.com/neoeinstein/protoc-gen-prost. Presuming this looks good, I'll be in a position to push up a protoc plugin crate binary.

@neoeinstein neoeinstein marked this pull request as ready for review February 24, 2022 22:58
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

This is a good start! Left a question but I think we are moving in the right direction.

prost-build/src/lib.rs Outdated Show resolved Hide resolved
prost-build/src/lib.rs Outdated Show resolved Hide resolved
prost-build/src/lib.rs Show resolved Hide resolved
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Almost there! Just two more comments then I think we are good to merge.

prost-build/src/lib.rs Outdated Show resolved Hide resolved
prost-build/src/lib.rs Show resolved Hide resolved
@neoeinstein
Copy link
Contributor Author

I believe that this is ready for a new review.

@LucioFranco LucioFranco changed the title Revive protoc plugin mode as protoc-gen-prost Expose generation methods for buf Mar 18, 2022
@LucioFranco LucioFranco merged commit 1f7546c into tokio-rs:master Mar 18, 2022
@neoeinstein neoeinstein deleted the protoc-gen-prost branch March 18, 2022 21:46
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.

2 participants