Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.5.0 does not build: libc dependency needs to be updated. #316

Open
Jire opened this issue Nov 28, 2024 · 3 comments
Open

Version 0.5.0 does not build: libc dependency needs to be updated. #316

Jire opened this issue Nov 28, 2024 · 3 comments

Comments

@Jire
Copy link

Jire commented Nov 28, 2024

Version 0.5.0 does not build: libc dependency needs to be updated.

My system:

                  -`                     jire@arch
                 .o+`                    ---------
                `ooo/                    OS: Arch Linux x86_64
               `+oooo:                   Host: MS-7D25 (1.0)
              `+oooooo:                  Kernel: Linux 6.12.1-zen1-1-zen
              -+oooooo+:                 Uptime: 7 hours, 20 mins
            `/:-:++oooo+:                Packages: 1092 (pacman)
           `/++++/+++++++:               Shell: zsh 5.9
          `/++++++++++++++:              Display (32GK850G): 2560x1440 @ 165 Hz in 32" [External]
         `/+++ooooooooooooo/`            Display (32QHD240): 2560x1440 @ 240 Hz in 32" [External] *
        ./ooosssso++osssssso+`           Display (DELL P2414H): 1920x1080 @ 60 Hz in 24" [External]
       .oossssso-````/ossssss+`          DE: GNOME 47.2
      -osssssso.      :ssssssso.         WM: Mutter (Wayland)
     :osssssss/        osssso+++.        WM Theme: Flat-Remix-Violet-Darkest-fullPanel
    /ossssssss/        +ssssooo/-        Theme: Adwaita [GTK2/3/4]
  `/ossssso+/:-        -:/+osssso+-      Icons: Adwaita [GTK2/3/4]
 `+sso+:-`                 `.-/+oso:     Font: Cantarell (11pt) [GTK2/3/4]
`++:.                           `-/+/    Cursor: Adwaita (24px)
.`                                 `/    Terminal: GNOME Console 47.1
                                         Terminal Font: JetBrains Mono (13pt)
                                         CPU: Intel(R) Core(TM) i7-14700K (28) @ 5.50 GHz
                                         GPU: NVIDIA GeForce RTX 4070
                                         Memory: 49.98 GiB / 125.61 GiB (40%)
                                         Swap: Disabled
                                         Disk (/): 186.57 GiB / 1022.50 GiB (18%) - xfs
                                         Local IP (enp5s0f0np0): 192.168.99.10/24
                                         Locale: en_US.UTF-8

Build failure output:

/home/jire/.cargo/bin/cargo build --color=always --message-format=json-diagnostic-rendered-ansi --target x86_64-unknown-linux-musl --profile release
   Compiling io-uring v0.6.4
   Compiling pin-utils v0.1.0
   Compiling futures-task v0.3.31
   Compiling futures-core v0.3.31
   Compiling futures-util v0.3.31
   Compiling tokio-uring v0.5.0
error[E0412]: cannot find type `statx` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/io/statx.rs:21:22
    |
21  |       statx: Box<libc::statx>,
    |                        ^^^^^
    |
   ::: /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs:9:1
    |
9   | / s! {
10  | |     pub struct stat {
11  | |         pub st_dev: ::dev_t,
12  | |         pub st_ino: ::ino_t,
...   |
122 | |     }
123 | | }
    | |_- similarly named struct `stat` defined here
    |
help: a struct with a similar name exists
    |
21  |     statx: Box<libc::stat>,
    |                      ~~~~
help: consider importing one of these structs
    |
1   + use crate::io::statx::types::statx;
    |
1   + use io_uring::types::statx;
    |
help: if you import `statx`, refer to it directly
    |
21  -     statx: Box<libc::statx>,
21  +     statx: Box<statx>,
    |

error[E0412]: cannot find type `statx` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/io/statx.rs:56:57
    |
56  |                           &mut *statx.statx as *mut libc::statx as *mut types::statx,
    |                                                           ^^^^^
    |
   ::: /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs:9:1
    |
9   | / s! {
10  | |     pub struct stat {
11  | |         pub st_dev: ::dev_t,
12  | |         pub st_ino: ::ino_t,
...   |
122 | |     }
123 | | }
    | |_- similarly named struct `stat` defined here
    |
help: a struct with a similar name exists
    |
56  |                         &mut *statx.statx as *mut libc::stat as *mut types::statx,
    |                                                         ~~~~
help: consider importing one of these structs
    |
1   + use crate::io::statx::types::statx;
    |
1   + use io_uring::types::statx;
    |
help: if you import `statx`, refer to it directly
    |
56  -                         &mut *statx.statx as *mut libc::statx as *mut types::statx,
56  +                         &mut *statx.statx as *mut statx as *mut types::statx,
    |

error[E0412]: cannot find type `statx` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/io/statx.rs:68:36
    |
68  |       type Output = io::Result<libc::statx>;
    |                                      ^^^^^
    |
   ::: /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs:9:1
    |
9   | / s! {
10  | |     pub struct stat {
11  | |         pub st_dev: ::dev_t,
12  | |         pub st_ino: ::ino_t,
...   |
122 | |     }
123 | | }
    | |_- similarly named struct `stat` defined here
    |
help: a struct with a similar name exists
    |
68  |     type Output = io::Result<libc::stat>;
    |                                    ~~~~
help: consider importing one of these structs
    |
1   + use crate::io::statx::types::statx;
    |
1   + use io_uring::types::statx;
    |
help: if you import `statx`, refer to it directly
    |
68  -     type Output = io::Result<libc::statx>;
68  +     type Output = io::Result<statx>;
    |

error[E0425]: cannot find value `STATX_TYPE` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/fs/create_dir_all.rs:196:27
    |
196 |     if builder.mask(libc::STATX_TYPE).pathname(path).is_err() {
    |                           ^^^^^^^^^^ not found in `libc`

error[E0412]: cannot find type `statx` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/fs/statx.rs:31:51
    |
31  |       pub async fn statx(&self) -> io::Result<libc::statx> {
    |                                                     ^^^^^
    |
   ::: /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs:9:1
    |
9   | / s! {
10  | |     pub struct stat {
11  | |         pub st_dev: ::dev_t,
12  | |         pub st_ino: ::ino_t,
...   |
122 | |     }
123 | | }
    | |_- similarly named struct `stat` defined here
    |
help: a struct with a similar name exists
    |
31  |     pub async fn statx(&self) -> io::Result<libc::stat> {
    |                                                   ~~~~
help: consider importing this struct
    |
1   + use io_uring::types::statx;
    |
help: if you import `statx`, refer to it directly
    |
31  -     pub async fn statx(&self) -> io::Result<libc::statx> {
31  +     pub async fn statx(&self) -> io::Result<statx> {
    |

error[E0425]: cannot find value `STATX_ALL` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/fs/statx.rs:33:26
    |
33  |         let mask = libc::STATX_ALL;
    |                          ^^^^^^^^^ help: a constant with a similar name exists: `STA_FLL`
    |
   ::: /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/mod.rs:752:1
    |
752 | pub const STA_FLL: ::c_int = 0x0008;
    | -------------------------- similarly named constant `STA_FLL` defined here

error[E0425]: cannot find value `STATX_ALL` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/fs/statx.rs:76:25
    |
76  |             mask: libc::STATX_ALL,
    |                         ^^^^^^^^^ help: a constant with a similar name exists: `STA_FLL`
    |
   ::: /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/mod.rs:752:1
    |
752 | pub const STA_FLL: ::c_int = 0x0008;
    | -------------------------- similarly named constant `STA_FLL` defined here

error[E0412]: cannot find type `statx` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/fs/statx.rs:105:65
    |
105 |   pub async fn statx<P: AsRef<Path>>(path: P) -> io::Result<libc::statx> {
    |                                                                   ^^^^^
    |
   ::: /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs:9:1
    |
9   | / s! {
10  | |     pub struct stat {
11  | |         pub st_dev: ::dev_t,
12  | |         pub st_ino: ::ino_t,
...   |
122 | |     }
123 | | }
    | |_- similarly named struct `stat` defined here
    |
help: a struct with a similar name exists
    |
105 | pub async fn statx<P: AsRef<Path>>(path: P) -> io::Result<libc::stat> {
    |                                                                 ~~~~
help: consider importing this struct
    |
1   + use io_uring::types::statx;
    |
help: if you import `statx`, refer to it directly
    |
105 - pub async fn statx<P: AsRef<Path>>(path: P) -> io::Result<libc::statx> {
105 + pub async fn statx<P: AsRef<Path>>(path: P) -> io::Result<statx> {
    |

error[E0425]: cannot find value `STATX_ALL` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/fs/statx.rs:165:25
    |
165 |             mask: libc::STATX_ALL,
    |                         ^^^^^^^^^ help: a constant with a similar name exists: `STA_FLL`
    |
   ::: /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/mod.rs:752:1
    |
752 | pub const STA_FLL: ::c_int = 0x0008;
    | -------------------------- similarly named constant `STA_FLL` defined here

error[E0412]: cannot find type `statx` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/fs/statx.rs:291:55
    |
291 |       pub async fn statx(&mut self) -> io::Result<libc::statx> {
    |                                                         ^^^^^
    |
   ::: /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs:9:1
    |
9   | / s! {
10  | |     pub struct stat {
11  | |         pub st_dev: ::dev_t,
12  | |         pub st_ino: ::ino_t,
...   |
122 | |     }
123 | | }
    | |_- similarly named struct `stat` defined here
    |
help: a struct with a similar name exists
    |
291 |     pub async fn statx(&mut self) -> io::Result<libc::stat> {
    |                                                       ~~~~
help: consider importing this struct
    |
1   + use io_uring::types::statx;
    |
help: if you import `statx`, refer to it directly
    |
291 -     pub async fn statx(&mut self) -> io::Result<libc::statx> {
291 +     pub async fn statx(&mut self) -> io::Result<statx> {
    |

error[E0425]: cannot find value `STATX_TYPE` in crate `libc`
   --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/fs/statx.rs:306:27
    |
306 |     if builder.mask(libc::STATX_TYPE).pathname(path).is_err() {
    |                           ^^^^^^^^^^ not found in `libc`

error[E0308]: mismatched types
  --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/io/sendmsg.rs:58:41
   |
58 |                 msghdr.msg_controllen = _msg_control.bytes_init();
   |                 ---------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `usize`
   |                 |
   |                 expected due to the type of this binding

error[E0308]: mismatched types
  --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/io/sendmsg.rs:62:41
   |
62 |                 msghdr.msg_controllen = 0_usize;
   |                 ---------------------   ^^^^^^^ expected `u32`, found `usize`
   |                 |
   |                 expected due to the type of this binding

error[E0308]: mismatched types
  --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/io/sendmsg_zc.rs:65:41
   |
65 |                 msghdr.msg_controllen = _msg_control.bytes_init();
   |                 ---------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `usize`
   |                 |
   |                 expected due to the type of this binding

error[E0308]: mismatched types
  --> /home/jire/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-uring-0.5.0/src/io/sendmsg_zc.rs:69:41
   |
69 |                 msghdr.msg_controllen = 0_usize;
   |                 ---------------------   ^^^^^^^ expected `u32`, found `usize`
   |                 |
   |                 expected due to the type of this binding

error: aborting due to 15 previous errors

Some errors have detailed explanations: E0308, E0412, E0425.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `tokio-uring` (lib) due to 16 previous errors
Process finished with exit code 101
@KreAch3R
Copy link

I get the same compilation error as well.

@evanrittenhouse
Copy link

evanrittenhouse commented Dec 28, 2024

@KreAch3R I noticed that the original issue comes up on x86 - are you on x86 as well? I'm on ARM and it seems to work fine (with a warning):

ubuntu@ubuntu:~/Documents/projects/tokio-uring$ cargo clean
     Removed 3037 files, 1020.5MiB total
ubuntu@ubuntu:~/Documents/projects/tokio-uring$ uname -m
aarch64
ubuntu@ubuntu:~/Documents/projects/tokio-uring$ cargo build
   Compiling libc v0.2.169
   Compiling autocfg v1.4.0
   Compiling io-uring v0.6.4
   Compiling pin-project-lite v0.2.15
   Compiling pin-utils v0.1.0
   Compiling futures-task v0.3.31
   Compiling futures-core v0.3.31
   Compiling bitflags v1.3.2
   Compiling slab v0.4.9
   Compiling futures-util v0.3.31
   Compiling mio v1.0.3
   Compiling socket2 v0.5.8
   Compiling socket2 v0.4.10
   Compiling tokio v1.42.0
   Compiling tokio-uring v0.5.0 (/home/ubuntu/Documents/projects/tokio-uring)
warning: elided lifetime has a name
   --> src/fs/create_dir_all.rs:127:78
    |
127 |     fn recurse_create_dir_all<'a>(&'a self, path: &'a Path) -> LocalBoxFuture<io::Result<()>> {
    |                               -- lifetime `'a` declared here                 ^ this elided lifetime gets resolved as `'a`
    |
    = note: `#[warn(elided_named_lifetimes)]` on by default

warning: `tokio-uring` (lib) generated 1 warning
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.11s
ubuntu@ubuntu:~/Documents/projects/tokio-uring$

What does cargo tree -i libc show?

@KreAch3R
Copy link

@KreAch3R I noticed that the original issue comes up on x86 - are you on x86 as well? I'm on ARM and it seems to work fine (with a warning):
...
What does cargo tree -i libc show?

Well, IIRC, I got this error when trying to compile https://github.com/manio/aa-proxy-rs for raspberry pi armhf 32bit (raspbian buster) using my Debian x64 PC.

This is the output you requested:

cargo tree -i libc
libc v0.2.161
├── atty v0.2.14
│   └── clap v3.2.25
│       └── aa-proxy-rs v0.2.0 (/media/ssd1/aa-proxy-rs)
├── bluer v0.17.3
│   └── aa-proxy-rs v0.2.0 (/media/ssd1/aa-proxy-rs)
├── dbus v0.9.7
│   ├── aa-proxy-rs v0.2.0 (/media/ssd1/aa-proxy-rs)
│   ├── bluer v0.17.3 (*)
│   ├── dbus-crossroads v0.5.2
│   │   └── bluer v0.17.3 (*)
│   └── dbus-tokio v0.7.6
│       └── bluer v0.17.3 (*)
├── dbus-tokio v0.7.6 (*)
├── getrandom v0.2.15
│   └── uuid v1.11.0
│       └── bluer v0.17.3 (*)
├── io-uring v0.6.4
│   └── tokio-uring v0.5.0
│       └── aa-proxy-rs v0.2.0 (/media/ssd1/aa-proxy-rs)
├── mio v1.0.2
│   └── tokio v1.41.0
│       ├── aa-proxy-rs v0.2.0 (/media/ssd1/aa-proxy-rs)
│       ├── bluer v0.17.3 (*)
│       ├── dbus-tokio v0.7.6 (*)
│       ├── tokio-fd v0.3.0
│       │   └── aa-proxy-rs v0.2.0 (/media/ssd1/aa-proxy-rs)
│       ├── tokio-stream v0.1.14
│       │   └── bluer v0.17.3 (*)
│       └── tokio-uring v0.5.0 (*)
├── netif v0.1.6
│   └── aa-proxy-rs v0.2.0 (/media/ssd1/aa-proxy-rs)
├── netlink-sys v0.8.6
│   └── aa-proxy-rs v0.2.0 (/media/ssd1/aa-proxy-rs)
├── nix v0.28.0
│   └── mac_address v1.1.7
│       └── aa-proxy-rs v0.2.0 (/media/ssd1/aa-proxy-rs)
├── nix v0.29.0
│   └── bluer v0.17.3 (*)
├── parking_lot_core v0.9.10
│   └── parking_lot v0.12.3
│       └── tokio v1.41.0 (*)
├── signal-hook-registry v1.4.2
│   └── tokio v1.41.0 (*)
├── socket2 v0.4.10
│   └── tokio-uring v0.5.0 (*)
├── socket2 v0.5.7
│   └── tokio v1.41.0 (*)
├── tokio v1.41.0 (*)
├── tokio-fd v0.3.0 (*)
└── tokio-uring v0.5.0 (*)

I managed to compile it statically using another way:

RUSTFLAGS='-C target-feature=+crt-static' cargo build --release

Check the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants