Skip to content

musl building problem expected i32, found u64 #153

Description

@realroot2185
OS: Alpine Linux v3.24 x86_64
commit 8a2d6bf80725a8252545e2f7d8cc12b279846726

I suppose this is a musl problem:

   Compiling fht-compositor-config v25.10.1 (/path/fht-compositor/fht-compositor-config)
error[E0308]: mismatched types
    --> src/backend/udev/surface.rs:463:60
     |
 463 |                     if libc::ioctl(drm_device.as_raw_fd(), ioctl_num, &mut create_blob) != 0 {
     |                        -----------                         ^^^^^^^^^ expected `i32`, found `u64`
     |                        |
     |                        arguments to this function are incorrect
     |
note: function defined here
    --> ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.186/src/unix/linux_like/mod.rs:1731:20
     |
1731 |             pub fn ioctl(fd: c_int, request: Ioctl, ...) -> c_int;
     |                    ^^^^^
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
     |
 463 |                     if libc::ioctl(drm_device.as_raw_fd(), ioctl_num.try_into().unwrap(), &mut create_blob) != 0 {
     |                                                                     ++++++++++++++++++++

For more information about this error, try `rustc --explain E0308`.
error: could not compile `fht-compositor` (bin "fht-compositor") due to 1 previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions