quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.88k stars 395 forks source link

quinn_udp build fails on DragonFlyBSD #1744

Open movepointsolutions opened 10 months ago

movepointsolutions commented 10 months ago
anek@dfly:~/quinn % cb Compiling quinn-udp v0.5.0 (/home/anek/quinn/quinn-udp) Compiling hdrhistogram v7.5.4 error[E0425]: cannot find value IP_RECVTOS in crate libc --> quinn-udp/src/unix.rs:72:79 72 if let Err(err) = set_socket_option(&*io, libc::IPPROTO_IP, libc::IP_RECVTOS, OPTION_ON) ^^^^^^^^^^ help: a constant with a similar name exists: IP_RECVIF

::: /home/anek/.cargo/git/checkouts/libc-68af43d2bf751e61/8585f41/src/unix/bsd/freebsdlike/mod.rs:964:1 | 964 | pub const IP_RECVIF: ::c_int = 20; | ---------------------------- similarly named constant IP_RECVIF defined here

error[E0412]: cannot find type mmsghdr in crate libc --> quinn-udp/src/unix.rs:224:26 224 let mut msgs: [libc::mmsghdr; BATCH_SIZE] = unsafe { mem::zeroed() }; ^^^^^^^ help: a struct with a similar name exists: cmsghdr

::: /home/anek/.cargo/git/checkouts/libc-68af43d2bf751e61/8585f41/src/unix/bsd/mod.rs:10:1 | 10 | / s! { 11 | | pub struct sockaddr { 12 | | pub sa_len: u8, 13 | | pub sa_family: sa_familyt, ... | 124 | | } 125 | | } | |- similarly named struct cmsghdr defined here

error[E0412]: cannot find type mmsghdr in crate libc --> quinn-udp/src/unix.rs:371:24 371 msgvec: *mut libc::mmsghdr, ^^^^^^^ help: a struct with a similar name exists: cmsghdr

::: /home/anek/.cargo/git/checkouts/libc-68af43d2bf751e61/8585f41/src/unix/bsd/mod.rs:10:1 | 10 | / s! { 11 | | pub struct sockaddr { 12 | | pub sa_len: u8, 13 | | pub sa_family: sa_familyt, ... | 124 | | } 125 | | } | |- similarly named struct cmsghdr defined here

error[E0425]: cannot find value SYS_sendmmsg in crate libc --> quinn-udp/src/unix.rs:378:39 | 378 | let ret = libc::syscall(libc::SYS_sendmmsg, sockfd, msgvec, vlen, flags) as libc::c_int; | ^^^^^^^^^^^^ not found in libc

error[E0412]: cannot find type mmsghdr in crate libc --> quinn-udp/src/unix.rs:410:24 410 msgvec: *mut libc::mmsghdr, ^^^^^^^ help: a struct with a similar name exists: cmsghdr

::: /home/anek/.cargo/git/checkouts/libc-68af43d2bf751e61/8585f41/src/unix/bsd/mod.rs:10:1 | 10 | / s! { 11 | | pub struct sockaddr { 12 | | pub sa_len: u8, 13 | | pub sa_family: sa_familyt, ... | 124 | | } 125 | | } | |- similarly named struct cmsghdr defined here

error[E0412]: cannot find type mmsghdr in crate libc --> quinn-udp/src/unix.rs:433:50 433 let mut hdrs = unsafe { mem::zeroed::<[libc::mmsghdr; BATCH_SIZE]>() }; ^^^^^^^ help: a struct with a similar name exists: cmsghdr

::: /home/anek/.cargo/git/checkouts/libc-68af43d2bf751e61/8585f41/src/unix/bsd/mod.rs:10:1 | 10 | / s! { 11 | | pub struct sockaddr { 12 | | pub sa_len: u8, 13 | | pub sa_family: sa_familyt, ... | 124 | | } 125 | | } | |- similarly named struct cmsghdr defined here

error[E0412]: cannot find type mmsghdr in crate libc --> quinn-udp/src/unix.rs:498:24 498 msgvec: *mut libc::mmsghdr, ^^^^^^^ help: a struct with a similar name exists: cmsghdr

::: /home/anek/.cargo/git/checkouts/libc-68af43d2bf751e61/8585f41/src/unix/bsd/mod.rs:10:1 | 10 | / s! { 11 | | pub struct sockaddr { 12 | | pub sa_len: u8, 13 | | pub sa_family: sa_familyt, ... | 124 | | } 125 | | } | |- similarly named struct cmsghdr defined here

error[E0412]: cannot find type mmsghdr in crate libc --> quinn-udp/src/unix.rs:539:24 539 msgvec: *mut libc::mmsghdr, ^^^^^^^ help: a struct with a similar name exists: cmsghdr

::: /home/anek/.cargo/git/checkouts/libc-68af43d2bf751e61/8585f41/src/unix/bsd/mod.rs:10:1 | 10 | / s! { 11 | | pub struct sockaddr { 12 | | pub sa_len: u8, 13 | | pub sa_family: sa_familyt, ... | 124 | | } 125 | | } | |- similarly named struct cmsghdr defined here

error[E0531]: cannot find unit struct, unit variant or constant IP_RECVTOS in crate libc --> quinn-udp/src/unix.rs:670:73 670 (libc::IPPROTO_IP, libc::IP_TOS) (libc::IPPROTO_IP, libc::IP_RECVTOS) => unsafe { ^^^^^^^^^^ help: a constant with a similar name exists: IP_RECVIF

::: /home/anek/.cargo/git/checkouts/libc-68af43d2bf751e61/8585f41/src/unix/bsd/freebsdlike/mod.rs:964:1 | 964 | pub const IP_RECVIF: ::c_int = 20; | ---------------------------- similarly named constant IP_RECVIF defined here

movepointsolutions commented 10 months ago

And it's unrelated to libc crate:


anek@dfly:~/libc % grep -r mmsghdr /usr/local/include/ /usr/include/
/usr/local/include/glib-2.0/gio/giotypes.h: * This structure closely mirrors 'struct mmsghdr' and 'struct msghdr' from
/usr/local/include/nice/agent.h: * #NiceInputMessage to struct mmsghdr.
/usr/local/include/nice/agent.h: * sendmmsg(); and #NiceOutputMessage to struct mmsghdr.
anek@dfly:~/libc % ```
djc commented 10 months ago

Please use code blocks in your GitHub comments -- this is pretty hard to read.

I suggest you submit a PR with changes to the compilation guards that make this work for you, as we don't really have a way to test this.