quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.86k stars 396 forks source link

build fails on Solaris #1877

Open psumbera opened 6 months ago

psumbera commented 6 months ago
   Compiling quinn-udp v0.5.1 (/home/psumbera/quinn/quinn-udp)
error[E0425]: cannot find value `IPV6_DONTFRAG` in crate `libc`
  --> quinn-udp/src/unix.rs:27:42
   |
27 | const IPV6_DONTFRAG: libc::c_int = libc::IPV6_DONTFRAG;
   |                                          ^^^^^^^^^^^^^ not found in `libc`

error[E0412]: cannot find type `in6_pktinfo` in crate `libc`
  --> quinn-udp/src/unix.rs:65:64
   |
65 |                 unsafe { libc::CMSG_SPACE(mem::size_of::<libc::in6_pktinfo>() as _) as usize };
   |                                                                ^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `IP_RECVTOS` in crate `libc`
  --> quinn-udp/src/unix.rs:87:79
   |
87 |             if let Err(err) = set_socket_option(&*io, libc::IPPROTO_IP, libc::IP_RECVTOS, OPTION_ON)
   |                                                                               ^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `IPV6_RECVTCLASS` in crate `libc`
   --> quinn-udp/src/unix.rs:156:63
    |
156 |             set_socket_option(&*io, libc::IPPROTO_IPV6, libc::IPV6_RECVTCLASS, OPTION_ON)?;
    |                                                               ^^^^^^^^^^^^^^^ not found in `libc`

error[E0412]: cannot find type `mmsghdr` in crate `libc`
   --> quinn-udp/src/unix.rs:358:50
    |
358 |       let mut hdrs = unsafe { mem::zeroed::<[libc::mmsghdr; BATCH_SIZE]>() };
    |                                                    ^^^^^^^ help: a struct with a similar name exists: `cmsghdr`
    |
   ::: /builds/psumbera/HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.155/src/unix/solarish/mod.rs:76:1
    |
76  | / s! {
77  | |     pub struct in_addr {
78  | |         pub s_addr: ::in_addr_t,
79  | |     }
...   |
475 | |     }
476 | | }
    | |_- similarly named struct `cmsghdr` defined here

error[E0412]: cannot find type `mmsghdr` in crate `libc`
   --> quinn-udp/src/unix.rs:423:24
    |
423 |       msgvec: *mut libc::mmsghdr,
    |                          ^^^^^^^ help: a struct with a similar name exists: `cmsghdr`
    |
   ::: /builds/psumbera/HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.155/src/unix/solarish/mod.rs:76:1
    |
76  | / s! {
77  | |     pub struct in_addr {
78  | |         pub s_addr: ::in_addr_t,
79  | |     }
...   |
475 | |     }
476 | | }
    | |_- similarly named struct `cmsghdr` defined here

error[E0425]: cannot find function `syscall` in crate `libc`
   --> quinn-udp/src/unix.rs:432:19
    |
432 |             libc::syscall(libc::SYS_recvmmsg, sockfd, msgvec, vlen, flags, timeout) as libc::c_int;
    |                   ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `SYS_recvmmsg` in crate `libc`
   --> quinn-udp/src/unix.rs:432:33
    |
432 |             libc::syscall(libc::SYS_recvmmsg, sockfd, msgvec, vlen, flags, timeout) as libc::c_int;
    |                                 ^^^^^^^^^^^^ not found in `libc`

error[E0412]: cannot find type `mmsghdr` in crate `libc`
   --> quinn-udp/src/unix.rs:464:24
    |
464 |       msgvec: *mut libc::mmsghdr,
    |                          ^^^^^^^ help: a struct with a similar name exists: `cmsghdr`
    |
   ::: /builds/psumbera/HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.155/src/unix/solarish/mod.rs:76:1
    |
76  | / s! {
77  | |     pub struct in_addr {
78  | |         pub s_addr: ::in_addr_t,
79  | |     }
...   |
475 | |     }
476 | | }
    | |_- similarly named struct `cmsghdr` defined here

error[E0425]: cannot find value `IP_TOS` in crate `libc`
    --> quinn-udp/src/unix.rs:519:50
     |
519  |             encoder.push(libc::IPPROTO_IP, libc::IP_TOS, ecn as IpTosTy);
     |                                                  ^^^^^^ help: a constant with a similar name exists: `IP_TTL`
     |
    ::: /builds/psumbera/HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.155/src/unix/solarish/mod.rs:1777:1
     |
1777 | pub const IP_TTL: ::c_int = 4;
     | ------------------------- similarly named constant `IP_TTL` defined here

error[E0425]: cannot find value `IPV6_TCLASS` in crate `libc`
   --> quinn-udp/src/unix.rs:522:48
    |
522 |         encoder.push(libc::IPPROTO_IPV6, libc::IPV6_TCLASS, ecn);
    |                                                ^^^^^^^^^^^ not found in `libc`

error[E0422]: cannot find struct, variant or union type `in6_pktinfo` in crate `libc`
   --> quinn-udp/src/unix.rs:559:37
    |
559 |                 let pktinfo = libc::in6_pktinfo {
    |                                     ^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `IPV6_PKTINFO` in crate `libc`
    --> quinn-udp/src/unix.rs:565:56
     |
565  |                 encoder.push(libc::IPPROTO_IPV6, libc::IPV6_PKTINFO, pktinfo);
     |                                                        ^^^^^^^^^^^^ help: a constant with a similar name exists: `IPV6_RECVPKTINFO`
     |
    ::: /builds/psumbera/HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.155/src/unix/solarish/mod.rs:1247:1
     |
1247 | pub const IPV6_RECVPKTINFO: ::c_int = 0x12;
     | ----------------------------------- similarly named constant `IPV6_RECVPKTINFO` defined here

error[E0531]: cannot find unit struct, unit variant or constant `IP_TOS` in crate `libc`
    --> quinn-udp/src/unix.rs:602:38
     |
602  |             (libc::IPPROTO_IP, libc::IP_TOS) => unsafe {
     |                                      ^^^^^^ help: a constant with a similar name exists: `IP_TTL`
     |
    ::: /builds/psumbera/HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.155/src/unix/solarish/mod.rs:1777:1
     |
1777 | pub const IP_TTL: ::c_int = 4;
     | ------------------------- similarly named constant `IP_TTL` defined here

error[E0531]: cannot find unit struct, unit variant or constant `IP_RECVTOS` in crate `libc`
   --> quinn-udp/src/unix.rs:607:38
    |
607 |             (libc::IPPROTO_IP, libc::IP_RECVTOS) => unsafe {
    |                                      ^^^^^^^^^^ not found in `libc`

error[E0531]: cannot find unit struct, unit variant or constant `IPV6_TCLASS` in crate `libc`
   --> quinn-udp/src/unix.rs:610:40
    |
610 |             (libc::IPPROTO_IPV6, libc::IPV6_TCLASS) => unsafe {
    |                                        ^^^^^^^^^^^ not found in `libc`

error[E0531]: cannot find unit struct, unit variant or constant `IPV6_PKTINFO` in crate `libc`
    --> quinn-udp/src/unix.rs:639:40
     |
639  |             (libc::IPPROTO_IPV6, libc::IPV6_PKTINFO) => {
     |                                        ^^^^^^^^^^^^ help: a constant with a similar name exists: `IPV6_RECVPKTINFO`
     |
    ::: /builds/psumbera/HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.155/src/unix/solarish/mod.rs:1247:1
     |
1247 | pub const IPV6_RECVPKTINFO: ::c_int = 0x12;
     | ----------------------------------- similarly named constant `IPV6_RECVPKTINFO` defined here

error[E0412]: cannot find type `in6_pktinfo` in crate `libc`
   --> quinn-udp/src/unix.rs:640:61
    |
640 |                 let pktinfo = unsafe { cmsg::decode::<libc::in6_pktinfo, libc::cmsghdr>(cmsg) };
    |                                                             ^^^^^^^^^^^ not found in `libc`

error[E0699]: cannot call a method on a raw pointer with an unknown pointee type
   --> quinn-udp/src/unix.rs:472:50
    |
472 |     let n = libc::recvmsg(sockfd, &mut (*msgvec).msg_hdr, flags);
    |                                                  ^^^^^^^

error[E0699]: cannot call a method on a raw pointer with an unknown pointee type
   --> quinn-udp/src/unix.rs:478:19
    |
478 |         (*msgvec).msg_len = n as _;
    |                   ^^^^^^^
djc commented 6 months ago

Thanks for the report! Would you be able to submit a PR addressing these issues in quinn-udp? #1863 might serve as an example of another recent PR adding platform support. It would be great if there would be a way to test that this doesn't regress in CI, if you know of a way doing that.

psumbera commented 4 months ago

I will do that. But before that following need to be resolved. https://github.com/rust-lang/libc/pull/3717

Ralith commented 4 months ago

It's okay to vendor those definitions in quinn-udp as a stopgap until libc updates.

mxinden commented 4 months ago

For the sake of completeness, corresponding discussion on Mozilla's Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1901295#c9

mxinden commented 2 weeks ago

@psumbera what do you think of keeping this open to track adding a check in CI?

In case running the unit tests on Solaris on CI is too much work, cross-compilation only would be a good step already, e.g. would have caught https://github.com/quinn-rs/quinn/pull/2029.

psumbera commented 2 weeks ago

I'm all to have Solaris on CI. I can imagine it can be quite complicated though. So let's keep this bug to track this effort.

psumbera commented 2 weeks ago

@psumbera what do you think of keeping this open to track adding a check in CI?

In case running the unit tests on Solaris on CI is too much work, cross-compilation only would be a good step already, e.g. would have caught #2029.

@mxinden, can you please point me how to play with FreeBSD CI and/or with cross-compiling. I have Linux to play..

EDITED: Anyway. I was able to enable github actions and start Solaris there. So I'm on it :-) Now I need to provide recent Rust version as Rustup doesn't work for Solaris yet.