kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
758 stars 238 forks source link

netifaces fails toolchain build #781

Open cobraPA opened 1 year ago

cobraPA commented 1 year ago

I see this is known, but started to investigate and hoped an issue was ok.

I see netifaces is marked as broken in CI.

I think the issue is in the kivy_ios recipe though, as I am able to install netifaces in a python 3.10 virtual env outside of a toolchain build. I also modified the recipe to use latest netifaces (0.11.0) which pip installs successfully.

OS: Monterey 12.6.3 Host Python: brew install python@3.10 kivy_ios: master from git, 3/10/2023

Snippet of log from 'python toolchain.py build netifaces' during setup.py portion (modified recipe for 0.11.0 and to inject Xcode iOS simulator include directory path to build_ext)

running build_ext
checking for getifaddrs...not found. 
checking for getnameinfo...not found. 
checking for socket IOCTLs...not found. 
checking for optional header files...net/if_dl.h. 
checking whether struct sockaddr has a length field...no. 
checking which sockaddr_xxx structs are defined...none! 
checking for routing socket support...no. 
checking for sysctl(CTL_NET...) support...no. 
checking for netlink support...no. 
building 'netifaces' extension
/var/folders/76/c5b27m1x24d4s... (858 more, please see e.stdout)
...
[DEBUG   ] netifaces.c:210:6: error: You need to add code for your platform.
[DEBUG   ] #    error You need to add code for your platform.
[DEBUG   ]      ^
[DEBUG   ] 1 error generated.

Expected results: (same python but second virtual env with only netifaces using 'pip install netifaces')

  running build_ext
  checking for getifaddrs...found.
  checking for getnameinfo...found.
  checking for IPv6 socket IOCTLs...['SIOCGIFAFLAG_IN6'].
  checking for optional header files...net/if_dl.h.
  checking whether struct sockaddr has a length field...yes.
  checking for routing socket support...yes.
  checking for sysctl(CTL_NET...) support...yes.
  checking for netlink support...no.
  will use sysctl() to read routing table
  building 'netifaces' extension
cobraPA commented 1 year ago

Additional observations, I see that the pip install uses clang and names both arch's x86_64 and arm64 at the same time. The failing toolchain build seems to setup a tmp dir for CC and CXX, and then only passes x86_64 in the first failing pass. I can't tell what the temp path points to, I think it is removed at the end of the toolchain build?

It looks like '/var/folders/76/c5b27m1x24d4sr4ldwyh7xrr0000gn/T/tmph9hvj_9g ' in my latest toolchain build. It appears like it should be a compiler binary or link.