-
Notifications
You must be signed in to change notification settings - Fork 59
continue prost #286
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
base: master
Are you sure you want to change the base?
continue prost #286
Conversation
@jokemanfire I appreciate you taking on this work very much. Thanks agian. |
There are some conflicts and API changes that need to be resolved and some code needs to be packaged to adapt to the current API. It's not easy to operate with the previous version of PR. I need to add some commit to complete this feature. I have communicated with the original author. |
dcf4304
to
781c816
Compare
@Tim-Zhang @justxuewei Local test all pass but i don't know how to install protoc in CI. |
21ebbd3
to
4a76b7b
Compare
a29312f
to
5fadae0
Compare
Basically enough @Tim-Zhang @justxuewei just take a look . :) |
Nice work, thanks @jokemanfire! Could you cleanup your commits? It makes us easier to review and maintain.
Thanks! |
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Fix all issues reported by cargo clippy to make ci testing pass. Signed-off-by: Xuewei Niu <[email protected]>
merge from remote branch. ref: containerd#173 Co-authored-by: Xuewei Niu <[email protected]> Signed-off-by: jokemanfire <[email protected]>
fix ci for protoc Signed-off-by: jokemanfire <[email protected]>
because of the api change 1. fix the marco in prost 2. fix the test Signed-off-by: jokemanfire <[email protected]>
fix rebase error. Signed-off-by: jokemanfire <[email protected]>
I have changed it. |
aa000cc
to
4da8148
Compare
b25b1a0
to
00fce61
Compare
skip build example2 in windows Signed-off-by: jokemanfire <[email protected]>
Once this feature gets merged, I prefer to bump a major version to 2 to avoid some compatibility issues, as it nearly changes the entire codegen engine. WDYT? @jokemanfire @Tim-Zhang |
This modification is indeed quite significant, and I agree. It depends on the maintainer's thoughts |
@@ -7,6 +7,11 @@ fn main() { | |||
let path: PathBuf = [out_dir.clone(), "mod.rs".to_string()].iter().collect(); | |||
fs::write(path, "pub mod ttrpc;").unwrap(); | |||
|
|||
generate_ttrpc(&out_dir); |
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.
To get unified internal APIs which was defined in ttrpc.proto, how about keeping build script untouched?
I think we can try to avoid so many condition compiling sentences like #[cfg(not(feature = "prost"))] in code.
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.
right ,I think adding a transformation to the camel hump naming convention can reduce this conditional compilation code
while use protoc,rename the Code enum. Signed-off-by: jokemanfire <[email protected]>
fix marco Signed-off-by: jokemanfire <[email protected]>
I tried to minimize conditional compilation as much as possible @Tim-Zhang @justxuewei |
work continue with #173