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

Can't build Tokio crate, on Haiku #7002

Open
vmlemon opened this issue Dec 2, 2024 · 2 comments · May be fixed by #7042
Open

Can't build Tokio crate, on Haiku #7002

vmlemon opened this issue Dec 2, 2024 · 2 comments · May be fixed by #7042
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug.

Comments

@vmlemon
Copy link

vmlemon commented Dec 2, 2024

Version
List the versions of all tokio crates you are using. The easiest way to get
this information is using cargo tree subcommand:

  Downloaded tokio v1.41.1
  Downloaded tokio-util v0.7.12
  Downloaded tokio-tungstenite v0.21.0
  Downloaded tokio-rustls v0.26.0
  Downloaded tokio-macros v2.4.0
  Downloaded tokio-io-utility v0.7.6
   Compiling tokio-macros v2.4.0

Platform
The output of uname -a (UNIX), or version and 32 or 64-bit (Windows)
Haiku shredder 1 hrev57937+125 Oct 26 2024 21:25 x86_64 x86_64 Haiku

Description
After installing Rust 1.83.0, on Haiku, along with OpenSSL 1.1.1w-2, and attempting to build the "rustic-rs" project, using Cargo, I encountered a failure to build the Tokio crate:

   Compiling tokio v1.41.1
error[E0425]: cannot find function `get_peer_cred` in module `ucred`
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/stream.rs:932:16
    |
932 |         ucred::get_peer_cred(self)
    |                ^^^^^^^^^^^^^ not found in `ucred`
    |
note: found an item that was configured out
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:40:34
    |
40  | pub(crate) use self::impl_linux::get_peer_cred;
    |                                  ^^^^^^^^^^^^^
note: the item is gated here
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:34:1
    |
34  | / #[cfg(any(
35  | |     target_os = "linux",
36  | |     target_os = "redox",
37  | |     target_os = "android",
38  | |     target_os = "openbsd"
39  | | ))]
    | |___^
note: found an item that was configured out
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:43:35
    |
43  | pub(crate) use self::impl_netbsd::get_peer_cred;
    |                                   ^^^^^^^^^^^^^
note: the item is gated here
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:42:1
    |
42  | #[cfg(any(target_os = "netbsd", target_os = "nto"))]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: found an item that was configured out
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:46:32
    |
46  | pub(crate) use self::impl_bsd::get_peer_cred;
    |                                ^^^^^^^^^^^^^
note: the item is gated here
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:45:1
    |
45  | #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: found an item that was configured out
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:55:34
    |
55  | pub(crate) use self::impl_macos::get_peer_cred;
    |                                  ^^^^^^^^^^^^^
note: the item is gated here
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:48:1
    |
48  | / #[cfg(any(
49  | |     target_os = "macos",
50  | |     target_os = "ios",
51  | |     target_os = "tvos",
52  | |     target_os = "watchos",
53  | |     target_os = "visionos"
54  | | ))]
    | |___^
note: found an item that was configured out
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:58:36
    |
58  | pub(crate) use self::impl_solaris::get_peer_cred;
    |                                    ^^^^^^^^^^^^^
note: the item is gated here
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:57:1
    |
57  | #[cfg(any(target_os = "solaris", target_os = "illumos"))]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: found an item that was configured out
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:61:32
    |
61  | pub(crate) use self::impl_aix::get_peer_cred;
    |                                ^^^^^^^^^^^^^
note: the item is gated behind the `aix` feature
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:60:7
    |
60  | #[cfg(target_os = "aix")]
    |       ^^^^^^^^^^^^^^^^^
note: found an item that was configured out
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:64:35
    |
64  | pub(crate) use self::impl_noproc::get_peer_cred;
    |                                   ^^^^^^^^^^^^^
note: the item is gated here
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/unix/ucred.rs:63:1
    |
63  | #[cfg(any(target_os = "espidf", target_os = "vita"))]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0425]: cannot find value `SIGIO` in crate `libc`
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/signal/unix.rs:152:20
    |
152 |         Self(libc::SIGIO)
    |                    ^^^^^ help: a constant with a similar name exists: `SIGIOT`
    |
   ::: /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.167/src/unix/mod.rs:247:1
    |
247 | pub const SIGIOT: c_int = 6;
    | ----------------------- similarly named constant `SIGIOT` defined here

   Compiling zerofrom-derive v0.1.5
error[E0599]: no method named `tos` found for struct `Socket` in the current scope
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/tcp/socket.rs:483:20
    |
483 |         self.inner.tos()
    |                    ^^^ method not found in `Socket`

error[E0599]: no method named `set_tos` found for struct `Socket` in the current scope
   --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/tcp/socket.rs:510:20
    |
510 |         self.inner.set_tos(tos)
    |                    ^^^^^^^
    |
help: there is a method `set_mss` with a similar name
    |
510 |         self.inner.set_mss(tos)
    |                    ~~~~~~~

error[E0599]: no method named `tos` found for struct `SockRef<'_>` in the current scope
    --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/udp.rs:1878:26
     |
1878 |         self.as_socket().tos()
     |         ----             ^^^ method not found in `SockRef<'_>`
     |         |
     |         method `tos` is available on `&udp::UdpSocket`

error[E0599]: no method named `set_tos` found for struct `SockRef<'_>` in the current scope
    --> /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/net/udp.rs:1905:26
     |
1905 |         self.as_socket().set_tos(tos)
     |         ----             ^^^^^^^
     |         |
     |         method `set_tos` is available on `&udp::UdpSocket`
     |
help: there is a method `set_mss` with a similar name
     |
1905 |         self.as_socket().set_mss(tos)
     |                          ~~~~~~~

As I am unfamiliar with the Rust ecosystem, and the Rust language, I figured that it'd make sense, to report this as a Tokio bug, to get the most "bang for the buck", in terms of enabling stuff to build. (There's a sibling bug, at haikuports/haikuports#11407, that bundles together issues related to this, on the Haiku side).

Unfortunately, I don't have an example of code that triggers this error, as it applies during the process of building the crate, itself, as a prerequisite.

Apologies, if this has already been reported, or if I'm better off, reporting it elsewhere...

@vmlemon vmlemon added A-tokio Area: The main tokio crate C-bug Category: This is a bug. labels Dec 2, 2024
@Darksonn
Copy link
Contributor

Darksonn commented Dec 3, 2024

@Thomasdezeeuw What is the state of haiku support in mio/socket2?

@Thomasdezeeuw
Copy link
Contributor

Haiku is supported in both Mio and socket2 with CI (using cargo check). However in socket2 it doesn't support all options, so this might be as simple as checking if the missing options are supported on Haiku or disabling/cfging-out the code in Tokio.

@Fancy2209 Fancy2209 linked a pull request Dec 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants