htrefil / rkvm

Virtual KVM switch for Linux machines
MIT License
395 stars 50 forks source link

Add the futures crate as dependency #5

Closed cheriimoya closed 3 years ago

cheriimoya commented 3 years ago

I tried building the package with my machine, didn't work. For reproducibility, i tried building inside of a docker container:

host ~$ docker run -it rust
docker /# apt update
docker /# apt install clang libevdev-dev
docker /# git clone https://github.com/htrefil/rkvm && cd rkvm
docker /# cargo build

The build fails with the following message:

   Compiling input v0.2.0 (/rkvm/input)
error[E0432]: unresolved import `futures`
 --> input/src/linux/event_manager.rs:4:5
  |
4 | use futures::StreamExt;
  |     ^^^^^^^ use of undeclared crate or module `futures`

error[E0599]: no method named `next` found for struct `EventStream<[u8; 512]>` in the current scope
   --> input/src/linux/event_manager.rs:111:36
    |
111 |     while let Some(event) = stream.next().await {
    |                                    ^^^^ method not found in `EventStream<[u8; 512]>`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `input`

To learn more, run the command again with --verbose.

Output of rustc --version is rustc 1.48.0 (7eac88abb 2020-11-16).

When adding the dependency, the build succeeds, so my guess would be that you might have a shared crates directory?;)

btw, awesome project, big fan!

htrefil commented 3 years ago

Thank you for the PR! Very odd that this didn't work as I don't have a shared crates dir (not one that I know about it anyway). I will merge it once I get to my computer, which should be approx. by the beginning of the next week.