pymobiledevice3 icon indicating copy to clipboard operation
pymobiledevice3 copied to clipboard

Failed to build pytun-pmd3

Open Implementist opened this issue 1 year ago • 1 comments

hi @doronz88 ! When I pip install pymobiledevice3==2.35.0under a linux server I got an error like this:

  × Building wheel for pytun-pmd3 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [79 lines of output]
      /tmp/pip-build-env-cgy9xnxv/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'extra_compile_args'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/test
      copying test/test_tap.py -> build/lib.linux-x86_64-cpython-310/test
      copying test/test_tun.py -> build/lib.linux-x86_64-cpython-310/test
      running egg_info
      writing pytun_pmd3.egg-info/PKG-INFO
      writing dependency_links to pytun_pmd3.egg-info/dependency_links.txt
      writing requirements to pytun_pmd3.egg-info/requires.txt
      writing top-level names to pytun_pmd3.egg-info/top_level.txt
      reading manifest file 'pytun_pmd3.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching 'README.rst'
      adding license file 'LICENSE'
      writing manifest file 'pytun_pmd3.egg-info/SOURCES.txt'
      running build_ext
      building 'pytun_pmd3' extension
      creating build/temp.linux-x86_64-cpython-310
      gcc -pthread -B /root/anaconda3/envs/py3.10_env/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /root/anaconda3/envs/py3.10_env/include -fPIC -O2 -isystem /root/anaconda3/envs/py3.10_env/include -fPIC -I/tmp/pip-install-cp4oc_1g/pytun-pmd3_e89a4bed68ae4825ae3276e19775cb7d -I/root/anaconda3/envs/py3.10_env/include/python3.10 -c linux_pytun.c -o build/temp.linux-x86_64-cpython-310/linux_pytun.o
      In file included from linux_pytun.c:17:0:
      /usr/include/linux/in6.h:30:8: error: redefinition of ‘struct in6_addr’
       struct in6_addr {
              ^~~~~~~~
      In file included from /usr/include/arpa/inet.h:22:0,
                       from linux_pytun.c:16:
      /usr/include/netinet/in.h:212:8: note: originally defined here
       struct in6_addr
              ^~~~~~~~
      In file included from linux_pytun.c:17:0:
      /usr/include/linux/in6.h:41:8: error: redefinition of ‘struct sockaddr_in6’
       struct sockaddr_in6 {
              ^~~~~~~~~~~~
      In file included from linux_pytun.c:10:0:
      /usr/include/sys/socket.h:91:17: note: originally defined here
       typedef union { __SOCKADDR_ALLTYPES
                       ^
      In file included from linux_pytun.c:17:0:
      /usr/include/linux/in6.h:49:8: error: redefinition of ‘struct ipv6_mreq’
       struct ipv6_mreq {
              ^~~~~~~~~
      In file included from /usr/include/arpa/inet.h:22:0,
                       from linux_pytun.c:16:
      /usr/include/netinet/in.h:291:8: note: originally defined here
       struct ipv6_mreq
              ^~~~~~~~~
      linux_pytun.c: In function ‘pytun_tuntap_get_addr’:
      linux_pytun.c:239:5: warning: passing argument 3 of ‘inet_ntop’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
           addr, INET6_ADDRSTRLEN);
           ^~~~
      In file included from linux_pytun.c:16:0:
      /usr/include/arpa/inet.h:64:20: note: expected ‘char * restrict’ but argument is of type ‘const char *’
       extern const char *inet_ntop (int __af, const void *__restrict __cp,
                          ^~~~~~~~~
      linux_pytun.c: In function ‘pytun_tuntap_get_dstaddr’:
      linux_pytun.c:347:5: warning: passing argument 3 of ‘inet_ntop’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
           dstaddr, INET6_ADDRSTRLEN);
           ^~~~~~~
      In file included from linux_pytun.c:16:0:
      /usr/include/arpa/inet.h:64:20: note: expected ‘char * restrict’ but argument is of type ‘const char *’
       extern const char *inet_ntop (int __af, const void *__restrict __cp,
                          ^~~~~~~~~
      linux_pytun.c: In function ‘pytun_tuntap_get_netmask’:
      linux_pytun.c:472:5: warning: passing argument 3 of ‘inet_ntop’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
           netmask, INET6_ADDRSTRLEN);
           ^~~~~~~
      In file included from linux_pytun.c:16:0:
      /usr/include/arpa/inet.h:64:20: note: expected ‘char * restrict’ but argument is of type ‘const char *’
       extern const char *inet_ntop (int __af, const void *__restrict __cp,
                          ^~~~~~~~~
      At top level:
      linux_pytun.c:79:12: warning: ‘if6_ioctl’ defined but not used [-Wunused-function]
       static int if6_ioctl(int cmd, struct in6_ifreq* req)
                  ^~~~~~~~~
      error: command '/usr/local/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 pytun-pmd3
Failed to build pytun-pmd3
ERROR: Could not build wheels for pytun-pmd3, which is required to install pyproject.toml-based projects

What could I do to get over of this problem?

Implementist avatar Dec 25 '23 13:12 Implementist

In general, should be an issue in pytun-pmd3. It sounds like an issue with setuptools. Try updating it

doronz88 avatar Dec 25 '23 13:12 doronz88