netifaces-2 icon indicating copy to clipboard operation
netifaces-2 copied to clipboard

Can't install on FreeBSD 14 due to missing methods

Open IchSchreiGleich opened this issue 10 months ago • 1 comments

I tried to install via pip and ran into a problem on FreeBSD:

Compiling netifaces v0.1.0 (/tmp/pip-install-dyyhyxi9/netifaces2_a4e6ec59b8ba427f8cc87b285b0ddf70)
      error[E0599]: no method named `as_netlink_addr` found for union `SockaddrStorage` in the current scope
        --> src/linux.rs:82:49
         |
      82 |                 if let Some(net_link) = address.as_netlink_addr() {
         |                                                 ^^^^^^^^^^^^^^^ help: there is a method with a similar name: `as_link_addr`

      error[E0599]: no method named `as_vsock_addr` found for union `SockaddrStorage` in the current scope
        --> src/linux.rs:87:51
         |
      87 |                 if let Some(vsock_addr) = address.as_vsock_addr() {
         |                                                   ^^^^^^^^^^^^^ help: there is a method with a similar name: `as_link_addr`

      error[E0599]: no method named `as_alg_addr` found for union `SockaddrStorage` in the current scope
        --> src/linux.rs:96:49
         |
      96 |                 if let Some(alg_addr) = address.as_alg_addr() {
         |                                                 ^^^^^^^^^^^ method not found in `SockaddrStorage`

After commenting out the lines following configstarget_os = "macos" (what is not good for macos is also not good for freebsd :p ), the result is

//#[cfg(not(any(target_os = "ios", target_os = "macos")))]
//if let Some(net_link) = address.as_link_addr() {
//    add_to_types_mat(AF_NETLINK, net_link, name, &mut types_mat, &mut any);
//}

and everything is fine. Maybe not the right way.

My "build" config is

export CARGO_BUILD_TARGET=x86_64-unknown-freebsd
export RUSTUP_HOME=~/.rustup
export CARGO_HOME=~/.cargo
export PATH=$CARGO_HOME/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin

IchSchreiGleich avatar Apr 27 '24 11:04 IchSchreiGleich

Same here, I'm trying to install the latest OctoPrint in a FreeBSD 13 jail which utilizes netifaces2 as well. I get the exactly same error on missing methods. It only complains about the following 3 methods:

  • as_netlink_addr()
  • as_vsock_addr()
  • as_alg_addr()

Apparently the method 'as_sockaddr_in()' is present.

ronzelver avatar May 02 '24 07:05 ronzelver