tokio-rs / tokio-uring

An io_uring backed runtime for Rust
MIT License
1.11k stars 117 forks source link

build error when try to build the tokio-uring #208

Closed gaowayne closed 1 year ago

gaowayne commented 1 year ago
[root@localhost tokio-uring]# cargo build
    Updating crates.io index
  Downloaded pin-project-lite v0.2.9
  Downloaded mio v0.8.5
  Downloaded tokio v1.23.0
  Downloaded io-uring v0.5.11
  Downloaded 4 crates (786.6 KB) in 1.02s
   Compiling autocfg v1.1.0
   Compiling libc v0.2.139
   Compiling log v0.4.17
   Compiling cfg-if v1.0.0
   Compiling io-uring v0.5.11
   Compiling bitflags v1.3.2
   Compiling pin-project-lite v0.2.9
   Compiling tokio v1.23.0
   Compiling slab v0.4.7
   Compiling socket2 v0.4.7
   Compiling mio v0.8.5
   Compiling tokio-uring v0.4.0 (/mnt/sda/sda5/wayne/rust/tokio-uring)
error[E0658]: `let...else` statements are unstable
   --> src/buf/fixed/registry.rs:239:9
    |
239 | /         let BufState::Free { init_len } = *state else {
240 | |             return None
241 | |         };
    | |__________^
    |
    = note: see issue #87335 <https://github.com/rust-lang/rust/issues/87335> for more information

error[E0658]: use of unstable library feature 'future_poll_fn'
 --> src/io/shared_fd.rs:2:5
  |
2 | use std::future::poll_fn;
  |     ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #72302 <https://github.com/rust-lang/rust/issues/72302> for more information

error[E0658]: use of unstable library feature 'future_poll_fn'
   --> src/io/shared_fd.rs:116:9
    |
116 |         poll_fn(|cx| {
    |         ^^^^^^^
    |
    = note: see issue #72302 <https://github.com/rust-lang/rust/issues/72302> for more information

error[E0658]: use of unstable library feature 'future_poll_fn'
   --> src/runtime/mod.rs:107:44
    |
107 |             .block_on(self.local.run_until(std::future::poll_fn(|cx| {
    |                                            ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #72302 <https://github.com/rust-lang/rust/issues/72302> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `tokio-uring` due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
[root@localhost tokio-uring]# 
FrankReh commented 1 year ago

Sorry, that first error makes it look like a newer rust compiler is needed. I think the project is still at the stage where it isn't trying to be compatible with older rust compiler versions. You may want to try on a machine where you can get rust and cargo of 1.66.0.

gaowayne commented 1 year ago

sorry, I am newbie to rust, is there any command that I can update my rust build tools?

[root@localhost tokio-uring]# cargo --version
cargo 1.56.0
[root@localhost tokio-uring]# cargo update
    Updating crates.io index
[root@localhost tokio-uring]# cargo --version
cargo 1.56.0
[root@localhost tokio-uring]# 
paolobarbolini commented 1 year ago

sorry, I am newbie to rust, is there any command that I can update my rust build tools?

You can use rustup update if you originally installed it via rustup.rs

gaowayne commented 1 year ago

thank you so much. now build is OK, but I cannot see any example binary is built

[root@localhost debug]# cd examples/
[root@localhost examples]# ls -l
total 0
[root@localhost examples]# pwd
/mnt/sda/sda5/wayne/rust/tokio-uring/target/debug/examples
[root@localhost examples]# 
Noah-Kennedy commented 1 year ago

Try this:

cargo build --examples
FrankReh commented 1 year ago

I'm going to close this. Please reopen if we've missed answering something. Thank you.

Noah-Kennedy commented 1 year ago

Also, if you keep having further issues, you can comment even if this is closed. We close issues to indicate that work doesn't need to be done on our end.