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

Replace netifaces by netifaces-plus #3053

Closed
nicolargo opened this issue Dec 27, 2024 · 3 comments
Closed

Replace netifaces by netifaces-plus #3053

nicolargo opened this issue Dec 27, 2024 · 3 comments
Labels
dependencies Pull requests that update a dependency file
Milestone

Comments

@nicolargo
Copy link
Owner

netifaces is deprecated (from a long time ago...), it should be replaced by netifaces-plus.

@nicolargo nicolargo added the dependencies Pull requests that update a dependency file label Dec 27, 2024
@nicolargo nicolargo added this to the Glances 4.3.1 milestone Dec 27, 2024
@nicolargo
Copy link
Owner Author

Pushed on the develop branch.

nicolargo added a commit that referenced this issue Dec 27, 2024
@nicolargo nicolargo reopened this Dec 27, 2024
@nicolargo
Copy link
Owner Author

netifaces-plus (as netifaces) can not be installed on latest Alpine image 3.21:

      building '_netifaces' extension
      creating build/temp.linux-x86_64-cpython-312/netifaces
      gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DNETIFACES_VERSION=0.12.4 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_LLC=1 -DHAVE_PF_NETLINK=1 -I/venv/include -I/usr/include/python3.12 -c netifaces/_netifaces.c -o build/temp.linux-x86_64-cpython-312/netifaces/_netifaces.o
      netifaces/_netifaces.c: In function 'ifaddrs':
      netifaces/_netifaces.c:1259:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
       1259 |     if (addr->ifa_name == NULL || strcmp (addr->ifa_name, ifname) != 0)
            |     ^~
      netifaces/_netifaces.c:1262:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
       1262 |       PyObject* ifinfo = getifaddrsinfo(addr);
            |       ^~~~~~~~
      netifaces/_netifaces.c: In function 'gateways':
      netifaces/_netifaces.c:2006:9: error: initialization of 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
       2006 |         NULL,
            |         ^~~~
      netifaces/_netifaces.c:2006:9: note: (near initialization for 'msghdr.__pad1')
      netifaces/_netifaces.c:2041:33: warning: comparison of integer expressions of different signedness: '__u32' {aka 'unsigned int'} and 'int' [-Wsign-compare]
       2041 |         if (pmsg->hdr.nlmsg_seq != seq || pmsg->hdr.nlmsg_pid != sanl.nl_pid)
            |                                 ^~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for netifaces-plus
Failed to build netifaces-plus
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (netifaces-plus)
/ # gcc -h
gcc: error: missing argument to '-h'
gcc: fatal error: no input files
compilation terminated.
/ # gcc --version
gcc (Alpine 14.2.0) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@nicolargo
Copy link
Owner Author

Related to tsukumijima/netifaces-plus#9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

1 participant