Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Upgrade tokio to 0.2 fails to compile #107

Closed
tac0turtle opened this issue Nov 27, 2019 · 2 comments · Fixed by #138
Closed

Upgrade tokio to 0.2 fails to compile #107

tac0turtle opened this issue Nov 27, 2019 · 2 comments · Fixed by #138
Labels
dependencies Pull requests that update a dependency file good first issue help wanted

Comments

@tac0turtle
Copy link
Contributor

error: failed to select a version for `tokio`.
    ... required by package `abci v0.6.4 (/Users/markobaricevic/code/abak0/CoTend/rust-abci)`
versions that meet the requirements `^0.2` are: 0.2.1, 0.2.0

the package `abci` depends on `tokio`, with features: `rt-full, codec, io` but `tokio` does not have these features.


failed to select a version for `tokio` which could resolve this conflict

&&


➜ cargo build
   Compiling abci v0.6.4 (/Users/markobaricevic/code/abak0/CoTend/rust-abci)
error[E0432]: unresolved import `tokio::codec`
 --> src/codec.rs:6:12
  |
6 | use tokio::codec::{Decoder, Encoder};
  |            ^^^^^ could not find `codec` in `tokio`

error[E0432]: unresolved import `tokio::codec`
 --> src/server.rs:7:12
  |
7 | use tokio::codec::Decoder;
  |            ^^^^^ could not find `codec` in `tokio`

error[E0432]: unresolved import `tokio::net::TcpListener`
 --> src/server.rs:9:5
  |
9 | use tokio::net::TcpListener;
  |     ^^^^^^^^^^^^^^^^^^^^^^^ no `TcpListener` in `net`

error[E0412]: cannot find type `Result` in module `io`
  --> src/server.rs:18:50
   |
18 | pub fn serve<A>(app: A, addr: SocketAddr) -> io::Result<()>
   |                                                  ^^^^^^ not found in `io`
   |
help: possible candidates are found in other modules, you can import them into scope
   |
1  | use core::fmt::Result;
   |
1  | use core::prelude::v1::Result;
   |
1  | use core::result::Result;
   |
1  | use futures::core_reexport::fmt::Result;
   |
     and 8 other candidates

error[E0425]: cannot find function `spawn` in crate `tokio`
  --> src/server.rs:45:20
   |
45 |             tokio::spawn(writes.then(|_| Ok(())))
   |                    ^^^^^ not found in `tokio`
   |
help: possible candidate is found in another module, you can import it into scope
   |
1  | use std::thread::spawn;
   |

warning: unused import: `tokio::prelude::*`
  --> src/server.rs:10:5
   |
10 | use tokio::prelude::*;
   |     ^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0412, E0425, E0432.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `abci`.
@snowsignal
Copy link
Contributor

A lot of things changed between Tokio 0.1 and 0.2. The biggest one was the switch to using async/await-based futures.

Discussion of using async/await took place over in issue #61. https://github.com/devashishdxt/abci-rs uses async/await, but not with Tokio. As far as I know nobody has made a fork of abci-rs yet that uses Tokio 0.2.

@devashishdxt
Copy link
Contributor

@inquisitivepenguin I added support for tokio = "0.2" in abci-rs = "0.4" using async/await.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file good first issue help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants