-
Notifications
You must be signed in to change notification settings - Fork 111
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
Use prost instead of rust-protobuf #829
Conversation
193ae98
to
c16fd28
Compare
heads-up to @project-oak/core and @wildarch . If anyone has any opinions about this please feel free to leave a comment. |
633b296
to
9b75a26
Compare
"Deliberate error", | ||
)); | ||
match req.method_result { | ||
Some(proto::grpc_test_request::MethodResult::ErrCode(err_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.
nit: use proto::grpc_test_request::MethodResult
crate::grpc::invoke_grpc_method( | ||
grpc_method_name, | ||
&operation_request, | ||
Some(&type_url), | ||
None, |
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.
IIRC the type_url
needed to be present in order for the C++ code to be able to reconstruct the inner protobuf request. Do the storage tests still work with this removed?
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.
Edit: looking at the Cloudbuild logs, looks like this is still a problem:
I0408 23:14:00.449162 23205 abitest.cc:76] [ FAIL ] Storage
I0408 23:14:00.449169 23205 abitest.cc:79] Details: Error: status code 3 message 'Failed to unpack request'
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.
Possible workaround in #831
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.
(also, we should remember to come back and ding the req_type_url
parameter to invoke_grpc_method_[stream]
now it's never used)
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.
Awesome stuff @tiziano88!
@@ -185,11 +186,10 @@ impl GrpcServerNode { | |||
http_request_body: &dyn hyper::body::Buf, | |||
) -> Result<GrpcRequest, GrpcServerError> { | |||
// Parse an HTTP request body as a [`protobuf::well_known_types::Any`] message. |
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.
Should this be prost_types::Any
now?
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.
Done.
pub mod proto { | ||
pub mod google { | ||
pub mod protobuf { | ||
include!(concat!(env!("OUT_DIR"), "/google.protobuf.rs")); |
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.
Do we actually use these types somewhere?
cfb6e46
to
24ee189
Compare
24ee189
to
0d383af
Compare
Main differences: - use `::default` instead of `::new` to create instances - use native field accessors - use native Option and Vec types for optional and repeated fields - dispatcher struct has a more qualified name - gRPC generator code is encapsulated in a prost ServiceGenerator - use `quote!` macros instead of string concatenation in the generator Fixes project-oak#668
0d383af
to
ed7c8da
Compare
W00t! |
Main differences:
::default
instead of::new
to create instancesquote!
macros instead of string concatenation in the generatorFixes #668
Checklist