Hoverbear / old-raft-rs

[Incomplete] A Raft implementation in Rust
https://hoverbear.github.io/raft-rs/raft/
MIT License
266 stars 41 forks source link

Undeclared trait name `capnp::traits::Owned`? #81

Closed gordysc closed 9 years ago

gordysc commented 9 years ago

Hey folks!

I'm eager to learn more about this implementation, but after following the README steps (thanks for those btw!) I'm hitting about 30 errors from capnp. They all appear to be around capnp::traits::Owned & capnp::traits::OwnedStruct. Is there a specific version I should be using here?

Owned

/tmp/raft/target/debug/build/raft-fe16a35e1a2d30bd/out/messages_capnp.rs:15:13: 15:39 error: use of undeclared trait name `capnp::traits::Owned` [E0405]
/tmp/raft/target/debug/build/raft-fe16a35e1a2d30bd/out/messages_capnp.rs:15   impl <'a> ::capnp::traits::Owned<'a> for Owned { type Reader = Reader<'a>; type Builder = Builder<'a>; type Pipeline = Pipeline; }

OwnedStruct

/tmp/raft/target/debug/build/raft-fe16a35e1a2d30bd/out/messages_capnp.rs:1026:13: 1026:45 error: use of undeclared trait name `capnp::traits::OwnedStruct` [E0405]
/tmp/raft/target/debug/build/raft-fe16a35e1a2d30bd/out/messages_capnp.rs:1026   impl <'a> ::capnp::traits::OwnedStruct<'a> for Owned { type Reader = Reader<'a>; type Builder = Builder<'a>; type Pipeline = Pipeline; }
dwrensha commented 9 years ago

Those traits were added in capnproto-rust version 0.4, which I published yesterday morning. Looks like the problem is that this project does not specify a version for the capnpc (schema compiler) crate:

[build-dependencies.capnpc]
git = "https://github.com/dwrensha/capnpc-rust"

but effectively pins to version 0.2.4 of the capnp (runtime library) crate by using @danburkert's fork:

[dependencies.capnp]
git = "https://github.com/danburkert/capnproto-rust"
branch = "async"
dwrensha commented 9 years ago

I would try changing the Cargo.toml like this:

[build-dependencies]
capnpc = "0.2.5"
Hoverbear commented 9 years ago

Hi! I'm working on pushing a fix right now.

gordysc commented 9 years ago

That did the trick, thank you so much!