grpc-rust icon indicating copy to clipboard operation
grpc-rust copied to clipboard

Build fails on Latest Commit

Open friddle opened this issue 3 years ago • 4 comments

error[E0053]: method read has an incompatible type for trait --> grpc-protobuf/src/lib.rs:25:5 | 25 | fn read(&self, buf: Bytes) -> grpc::Result<M> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct bytes::bytes::Bytes, found struct bytes::Bytes | = note: expected fn pointer fn(&MarshallerProtobuf, bytes::bytes::Bytes) -> std::result::Result<_, _> found fn pointer fn(&MarshallerProtobuf, bytes::Bytes) -> std::result::Result<_, _> = note: perhaps two different versions of crate bytes are being used?

rustc 1.49.0 (e1884a8e3 2020-12-29) commit e8a9b95d834fdcfd811e440dd3fbd0b9a7f71630

friddle avatar Jan 05 '21 14:01 friddle

I was able to get past this by forcing protobuf and protoc-rust to version 2.17.0 in my Cargo.toml. The problem is that later versions of these crates upgrade the version of bytes above 0.5 while grpc-rust still uses bytes v0.5.

thomasantony avatar Jan 11 '21 17:01 thomasantony

thanks

friddle avatar Jan 14 '21 08:01 friddle

Met the same issue:

error[E0308]: mismatched types
  --> C:\Users\Winterreise\scoop\persist\rustup\.cargo\registry\src\github.com-1ecc6299db9ec823\grpc-protobuf-0.8.2\src\lib.rs:27:62
   |
27 |         let mut is = CodedInputStream::from_carllerche_bytes(&buf);
   |                                                              ^^^^ expected struct `bytes::bytes::Bytes`, found struct `bytes::Bytes`
   |
   = note: expected reference `&bytes::bytes::Bytes`
              found reference `&bytes::Bytes`
   = note: perhaps two different versions of crate `bytes` are being used?

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `grpc-protobuf`

tan-wei avatar Feb 13 '21 12:02 tan-wei

protobuf = "2.14.0"
protoc-rust        = "2.14.0"

cargo update -p protobuf --precise 2.14.0

friddle avatar Feb 17 '21 13:02 friddle