tikv / raft-rs

Raft distributed consensus algorithm implemented in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crate won't build

sp1ff opened this issue Β· comments

Describe the bug
Headline says it all, after doing cargo add raft (which added 'raft = "0.6.0"' to my Cargo.toml) I tried to build my project & was greeted with a raft of errors in crate raft-proto v0.6.0 (see what I did there? πŸ˜„ ) Errors included below.

To Reproduce
Steps to reproduce the behavior:

Add raft to your project & type cargo build.

Expected behavior
Either a successful build, or, at worst, errors in my own code (not your crate).

System information

  • CPU architecture: x86_64
  • Distribution and kernel version: Arch, 5.15.15-76051515-generic
  • SELinux on?: No
  • Any other system details we should know?: No

Additional context
Compilation errors here:

Click to expand

Compiling raft-proto v0.6.0
error[E0425]: cannot find function read_singular_proto3_carllerche_bytes_into in module protobuf::rt
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:191:37
|
191 | ::protobuf::rt::read_singular_proto3_carllerche_bytes_into(wire_type, is, &mut self.data)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: read_singular_proto3_bytes_into
|
::: /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-2.27.1/src/rt.rs:737:1
|
737 | / pub fn read_singular_proto3_bytes_into(
738 | | wire_type: WireType,
739 | | is: &mut CodedInputStream,
740 | | target: &mut Vec,
741 | | ) -> ProtobufResult<()> {
| |_______________________- similarly named function read_singular_proto3_bytes_into defined here

error[E0425]: cannot find function read_singular_proto3_carllerche_bytes_into in module protobuf::rt
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:194:37
|
194 | ::protobuf::rt::read_singular_proto3_carllerche_bytes_into(wire_type, is, &mut self.context)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: read_singular_proto3_bytes_into
|
::: /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-2.27.1/src/rt.rs:737:1
|
737 | / pub fn read_singular_proto3_bytes_into(
738 | | wire_type: WireType,
739 | | is: &mut CodedInputStream,
740 | | target: &mut Vec,
741 | | ) -> ProtobufResult<()> {
| |_______________________- similarly named function read_singular_proto3_bytes_into defined here

error[E0412]: cannot find type ProtobufTypeCarllercheBytes in module protobuf::types
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:310:107
|
310 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeCarllercheBytes>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in protobuf::types

error[E0412]: cannot find type ProtobufTypeCarllercheBytes in module protobuf::types
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:315:107
|
315 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeCarllercheBytes>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in protobuf::types

error[E0425]: cannot find function read_singular_proto3_carllerche_bytes_into in module protobuf::rt
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:703:37
|
703 | ::protobuf::rt::read_singular_proto3_carllerche_bytes_into(wire_type, is, &mut self.data)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: read_singular_proto3_bytes_into
|
::: /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-2.27.1/src/rt.rs:737:1
|
737 | / pub fn read_singular_proto3_bytes_into(
738 | | wire_type: WireType,
739 | | is: &mut CodedInputStream,
740 | | target: &mut Vec,
741 | | ) -> ProtobufResult<()> {
| |_______________________- similarly named function read_singular_proto3_bytes_into defined here

error[E0412]: cannot find type ProtobufTypeCarllercheBytes in module protobuf::types
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:779:107
|
779 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeCarllercheBytes>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in protobuf::types

error[E0425]: cannot find function read_singular_proto3_carllerche_bytes_into in module protobuf::rt
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:1221:37
|
1221 | ::protobuf::rt::read_singular_proto3_carllerche_bytes_into(wire_type, is, &mut self.context)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: read_singular_proto3_bytes_into
|
::: /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-2.27.1/src/rt.rs:737:1
|
737 | / pub fn read_singular_proto3_bytes_into(
738 | | wire_type: WireType,
739 | | is: &mut CodedInputStream,
740 | | target: &mut Vec,
741 | | ) -> ProtobufResult<()> {
| |_______________________- similarly named function read_singular_proto3_bytes_into defined here

error[E0412]: cannot find type ProtobufTypeCarllercheBytes in module protobuf::types
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:1447:107
|
1447 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeCarllercheBytes>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in protobuf::types

error[E0425]: cannot find function read_singular_proto3_carllerche_bytes_into in module protobuf::rt
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:2157:37
|
2157 | ::protobuf::rt::read_singular_proto3_carllerche_bytes_into(wire_type, is, &mut self.context)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: read_singular_proto3_bytes_into
|
::: /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-2.27.1/src/rt.rs:737:1
|
737 | / pub fn read_singular_proto3_bytes_into(
738 | | wire_type: WireType,
739 | | is: &mut CodedInputStream,
740 | | target: &mut Vec,
741 | | ) -> ProtobufResult<()> {
| |_______________________- similarly named function read_singular_proto3_bytes_into defined here

error[E0412]: cannot find type ProtobufTypeCarllercheBytes in module protobuf::types
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:2256:107
|
2256 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeCarllercheBytes>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in protobuf::types

error[E0425]: cannot find function read_singular_proto3_carllerche_bytes_into in module protobuf::rt
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:2595:37
|
2595 | ::protobuf::rt::read_singular_proto3_carllerche_bytes_into(wire_type, is, &mut self.context)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: read_singular_proto3_bytes_into
|
::: /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-2.27.1/src/rt.rs:737:1
|
737 | / pub fn read_singular_proto3_bytes_into(
738 | | wire_type: WireType,
739 | | is: &mut CodedInputStream,
740 | | target: &mut Vec,
741 | | ) -> ProtobufResult<()> {
| |_______________________- similarly named function read_singular_proto3_bytes_into defined here

error[E0412]: cannot find type ProtobufTypeCarllercheBytes in module protobuf::types
--> /home/michael/code/projects/airflow-bridge/target/debug/build/raft-proto-22b5c968b7f9e56e/out/protos/eraftpb.rs:2684:107
|
2684 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeCarllercheBytes>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in protobuf::types

Some errors have detailed explanations: E0412, E0425.
For more information about an error, try rustc --explain E0412.
error: could not compile raft-proto due to 12 previous errors

@sp1ff seems that to have that method, protobuf need to include the bytes feature, adding

protobuf = { version = "2", features = ["bytes"] }

fixed the problem for me

commented

Seems we should enable the features for raft-proto.