servo / ipc-channel

A multiprocess drop-in replacement for Rust channels
Apache License 2.0
873 stars 129 forks source link

Build fails on FreeBSD: error[E0425]: cannot find value `POLLRDHUP` in crate `libc` #337

Open yurivict opened 5 months ago

yurivict commented 5 months ago
rror[E0425]: cannot find value `POLLRDHUP` in crate `libc`
    --> /home/yuri/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ipc-channel-0.18.0/src/platform/unix/mod.rs:1162:67
     |
1162 |                 let events = libc::POLLIN | libc::POLLPRI | libc::POLLRDHUP;
     |                                                                   ^^^^^^^^^ help: a constant with a similar name exists: `POLLHUP`
     |
    ::: /home/yuri/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/bsd/mod.rs:477:1
     |
477  | pub const POLLHUP: ::c_short = 0x10;
     | ---------------------------- similarly named constant `POLLHUP` defined here

error[E0308]: mismatched types
    --> /home/yuri/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ipc-channel-0.18.0/src/platform/unix/mod.rs:1170:21
     |
1168 |                 let result = libc::poll(
     |                              ---------- arguments to this function are incorrect
1169 |                     fd.as_mut_ptr(),
1170 |                     fd.len() as libc::c_ulong,
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`

Version: 0.18.0 FreeBSD 14.0

landryb commented 2 months ago

same error seen on OpenBSD, fwiw

jdm commented 2 months ago

Ah, this will.be fixed when we release a new version that includes https://github.com/servo/ipc-channel/commit/da28df996c22c5b72f95a4bb594689943fc3c7f5. You can use the main branch in the meantime.

landryb commented 1 month ago

OpenBSD doesn't have that #define: https://github.com/openbsd/src/blob/master/sys/sys/poll.h#L39

sagudev commented 1 month ago

I think we should push fix to lib for POLLRDHUPon freebsd.