codegen: Introduce a new codegen using prost#173
Closed
justxuewei wants to merge 4 commits intocontainerd:masterfrom
Closed
codegen: Introduce a new codegen using prost#173justxuewei wants to merge 4 commits intocontainerd:masterfrom
justxuewei wants to merge 4 commits intocontainerd:masterfrom
Conversation
Codecov ReportBase: 25.71% // Head: 25.64% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #173 +/- ##
==========================================
- Coverage 25.71% 25.64% -0.08%
==========================================
Files 16 16
Lines 2399 2406 +7
==========================================
Hits 617 617
- Misses 1782 1789 +7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
a274a9e to
6dc75f5
Compare
This commit refactors the ttrpc-codegen and the compiler, and merges the two crates into a single crate, named "codegen". The codegen uses prost crate, a protobuf compiler for Rust. Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
The ttrpc provides a "prost" feature to support the new version of codegen. An "example2" has been added to demonstrate how to use the codegen. Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
Install protoc when executing `make deps` of the ttrpc. Add codegen's check and build, and example2' build to the ci testing. Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
5f8f5b8 to
f80fa73
Compare
Fix all issues reported by cargo clippy to make ci testing pass. Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
wllenyj
reviewed
Feb 21, 2023
| prost-build = "0.11" | ||
| proc-macro2 = "1.0" | ||
| quote = "1.0" | ||
| anyhow = "^1.0" |
Collaborator
There was a problem hiding this comment.
Use anyhow="1.0" directly.
Member
|
Hold this and going to reopen it when we need replace rust-protobuf in the future |
jokemanfire
added a commit
to jokemanfire/ttrpc-rust
that referenced
this pull request
Feb 24, 2025
ref: containerd#173 Co-authored-by: jokemanfire <hu.dingyang@zte.com.cn> Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
Open
jokemanfire
added a commit
to jokemanfire/ttrpc-rust
that referenced
this pull request
Feb 28, 2025
ref: containerd#173 Co-authored-by: Xuewei Niu <niuxuewei.nxw@antgroup.com> Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
jokemanfire
added a commit
to jokemanfire/ttrpc-rust
that referenced
this pull request
Mar 13, 2025
ref: containerd#173 Co-authored-by: Xuewei Niu <niuxuewei.nxw@antgroup.com> Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
jokemanfire
added a commit
to jokemanfire/ttrpc-rust
that referenced
this pull request
Mar 13, 2025
ref: containerd#173 Co-authored-by: Xuewei Niu <niuxuewei.nxw@antgroup.com> Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
jokemanfire
added a commit
to jokemanfire/ttrpc-rust
that referenced
this pull request
Apr 10, 2025
merge from remote branch. ref: containerd#173 Co-authored-by: Xuewei Niu <niuxuewei.nxw@antgroup.com> Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature, prost, for the ttrpc-rust. The Prost is a modern Protobuf compiler that leverages the power of procedural macro of Rust. Currently, the prost version supports sync, async, and streaming. Here is part of the directory structure:
The ttrpc-rust is compatible with the older version, while there are certain differences:
ttrpc = { version = "1.0", features = ["prost"] }.CPUis generated by the Rust-protobuf, andCpuis generated by the Prost."example2" gives some examples on how to use it. The functionalities are completely the same as "example".
Fixes: #170
codegen: Introduce a new codegen using prost
This pull request refactors the ttrpc-codegen and the compiler, and merges the two crates into a single crate, named "codegen". The codegen uses prost crate, a protobuf compiler for Rust.
Signed-off-by: Xuewei Niu niuxuewei.nxw@antgroup.com
ttrpc-rust: Support the new version of codegen
The ttrpc provides a "prost" feature to support the new version of
codegen. An "example2" has been added to demonstrate how to use the
codegen.
Signed-off-by: Xuewei Niu niuxuewei.nxw@antgroup.com
ci: Add codegen-related ci testing
Install protoc when executing
make depsof the ttrpc. Add codegen'scheck and build, and example2' build to the ci testing.
Signed-off-by: Xuewei Niu niuxuewei.nxw@antgroup.com
codegen: Fix issues reported by cargo clippy
Fix all issues reported by cargo clippy to make ci testing pass.
Signed-off-by: Xuewei Niu niuxuewei.nxw@antgroup.com