Closed shangsony closed 3 years ago
I'm working on upgrade.
For now dependency version should be explicitly restricted to older version.
I'm attempting to restrict the dependencies to an older version using this...
protobuf = "=2.17.0"
protoc-rust = "=2.17.0"
Which seemed to resolve the build error above, however I then get errors like this...
error[E0599]: no function or associated item named `parse_from_bytes` found for trait object `(dyn protobuf::Message + 'static)` in the current scope
--> src/transientstore.rs:308:26
|
308 | ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
| ^^^^^^^^^^^^^^^^
| |
| function or associated item not found in `(dyn protobuf::Message + 'static)`
| help: there is an associated function with a similar name: `merge_from_bytes`
error: aborting due to 40 previous errors
Guessing wildly, I wondered if that's due to the generated files now being out of step...
// This file is generated by rust-protobuf 2.20.0. Do not edit
I tried cargo install grpc-compiler --version 0.8.2 --locked
which looked like it picked up a matching version of protobuf
Updating crates.io index
Installing grpc-compiler v0.8.2
Compiling protobuf v2.17.0
Compiling protobuf-codegen v2.17.0
Compiling grpc-compiler v0.8.2
Unfortunately the generated files looked the same. Any tips for what else I could try appreciated, otherwise I'll wait for the upgrade. Thanks.
Updated version to 0.8.3 which should fix the compilation.
Protobuf version is pinned to 2.18.2 to fix incompatibility with bytes crate.
Update to grpc to latest protobuf and other crates is WIP.
Please reopen if the issue persists.
Hi @stepancheg, I'm still having trouble getting things to work when generating code with protoc but I'm not sure whether it's really this issue, or something else I'm doing wrong- still seeing // This file is generated by rust-protobuf 2.20.0. Do not edit
in the generated files which looks suspicious. Just a side project but if you think it's worth opening a new issue somewhere, or reopening this one, please let me know. Thanks.
warning: 1 warning emitted
conf
--> grpc/src/server/mod.rs:81:5= note:
#[warn(dead_code)]
on by defaultwarning: field is never read:>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sender
--> grpc/src/req.rs:77:5 | 77 | sender: Option<mpsc::SenderCompiling grpc-protobuf v0.8.2 (/mnt/d/work/geely/rust_test/grpc-rust/grpc-protobuf) warning: 2 warnings emitted
bytes::bytes::Bytes
, found a different structbytes::bytes::Bytes
= note: expected reference
&bytes::bytes::Bytes
(structbytes::bytes::Bytes
) found reference&bytes::bytes::Bytes
(structbytes::bytes::Bytes
) = note: perhaps two different versions of cratebytes
are being used?error: aborting due to previous error
For more information about this error, try
rustc --explain E0308
. error: could not compilegrpc-protobuf
.To learn more, run the command again with --verbose. warning: build failed, waiting for other jobs to finish... error: build failed