kivy / kivy-ios

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

Pillow not building #907

Closed the-JACK-pot closed 6 months ago

the-JACK-pot commented 6 months ago

Versions

Describe the bug I have successfully built Kivy and many other recipes, to the point of successfully creating an Xcode project. The issue, however, is that Pillow can't seem to build properly, which both kivy-ios requires (according to pip) and so does a few other libraries and an AI of my creation.

The main error, from what I've interpreted, is fatal error: 'Python.h' file not found. This error occurs with a few other recipes that refuse to build. Here's my toolchain status output. Note: each recipe that is built is one that can be built, and the one's that aren't refuse to do so:

audiostream  - Not built
click        - Build OK (built at 2024-04-15 10:17:03.210452)
curly        - Not built
cymunk       - Not built
ffmpeg       - Build OK (built at 2024-04-17 15:14:39.671744)
ffpyplayer   - Not built
flask        - Build OK (built at 2024-04-15 10:17:19.206515)
freetype     - Build OK (built at 2024-04-10 07:30:53.795503)
hostopenssl  - Build OK (built at 2024-04-09 18:51:16.728783)
hostpython3  - Build OK (built at 2024-04-09 18:54:13.758185)
ios          - Build OK (built at 2024-04-09 18:56:29.332894)
itsdangerous - Build OK (built at 2024-04-15 10:17:06.234174)
jinja2       - Build OK (built at 2024-04-15 10:17:16.776255)
kivent_core  - Not built
kivy         - Build OK (built at 2024-04-09 18:58:06.030746)
kiwisolver   - Not built
libcurl      - Build OK (built at 2024-04-17 14:35:05.594776)
libffi       - Build OK (built at 2024-04-09 18:52:00.083883)
libjpeg      - Build OK (built at 2024-04-10 07:31:03.949128)
libpng       - Build OK (built at 2024-04-09 18:52:16.936014)
libzbar      - Build OK (built at 2024-04-17 14:51:46.818160)
markupsafe   - Build OK (built at 2024-04-15 10:17:09.717590)
materialyoucolor - Not built
matplotlib   - Not built
netifaces    - Not built
numpy        - Not built
openssl      - Build OK (built at 2024-04-09 18:52:44.673588)
photolibrary - Not built
pillow       - Not built
plyer        - Build OK (built at 2024-04-15 10:54:52.662713)
py3dns       - Build OK (built at 2024-04-17 15:28:38.000502)
pycrypto     - Not built
pykka        - Build OK (built at 2024-04-17 15:32:50.048065)
pyobjus      - Build OK (built at 2024-04-09 18:56:44.794768)
python3      - Build OK (built at 2024-04-09 18:56:23.628178)
pyyaml       - Build OK (built at 2024-04-15 10:52:28.120744)
sdl2         - Build OK (built at 2024-04-09 18:53:01.353536)
sdl2_image   - Build OK (built at 2024-04-09 18:54:25.308212)
sdl2_mixer   - Build OK (built at 2024-04-09 18:54:36.676428)
sdl2_ttf     - Build OK (built at 2024-04-09 18:54:53.003968)
werkzeug     - Build OK (built at 2024-04-15 10:17:13.482840)
zbarlight    - Not built

To Reproduce

Expected behavior I'm aiming to have the Pillow recipe built through the toolchain, so I may update my Xcode project and move on with my App Development asap.

Logs This was in the middle of a big stretch of plain logs, but I put it here just in case it's worth noting

INFO    ] Build_all pillow
[INFO    ] Build pillow for iphoneos-arm64, iphonesimulator-arm64 (filtered)
[INFO    ] Build pillow
[WARNING ] pillow build for arm64 has been incomplete
[WARNING ] Warning: deleting the build and restarting.
[INFO    ] Extract /Users/jack/Documents/workshop/KivyBuilds/.cache/pillow-Pillow-8.2.0.tar.gz into /Users/jack/Documents/workshop/KivyBuilds/build/pillow/iphoneos-arm64
[INFO    ] Running Shell: /usr/bin/tar ('-C', '/Users/jack/Documents/workshop/KivyBuilds/build/pillow/iphoneos-arm64', '-xv', '-z', '-f', '/Users/jack/Documents/workshop/KivyBuilds/.cache/pillow-Pillow-8.2.0.tar.gz') {'_iter': True, '_out_bufsize': 1, '_err_to_out': True}

Here are the logs where it starts to show errors and eventually, trip up

[DEBUG   ] Checking for include file xcb/xcb.h in /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi
[DEBUG   ] Checking for include file xcb/xcb.h in /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg
[DEBUG   ] Checking for include file xcb/xcb.h in /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl
[DEBUG   ] Checking for include file xcb/xcb.h in /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64
[DEBUG   ] Checking for include file xcb/xcb.h in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include
[DEBUG   ] Checking for include file xcb/xcb.h in /Users/jack/Documents/workshop/KivyBuilds/dist/hostpython3/include
[DEBUG   ] Checking for include file xcb/xcb.h in /Users/jack/Desktop/KivyBuilds/dist/hostpython3/include/python3.11
[DEBUG   ] building 'PIL._imaging' extension
[DEBUG   ] building 'PIL._imagingft' extension
[DEBUG   ] creating build
[DEBUG   ] building 'PIL._imagingtk' extension
[DEBUG   ] creating build/temp.macosx-14.4-arm64-cpython-311
[DEBUG   ] creating build/temp.macosx-14.4-arm64-cpython-311
[DEBUG   ] creating build/temp.macosx-14.4-arm64-cpython-311/src
[DEBUG   ] creating build/temp.macosx-14.4-arm64-cpython-311/src
[DEBUG   ] creating build/temp.macosx-14.4-arm64-cpython-311/src
[DEBUG   ] building 'PIL._imagingmath' extension
[DEBUG   ] /tmp/tmp5kp7njm7 -O3 -miphoneos-version-min=9.0 -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64 -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -arch arm64 -g -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include -I/Users/jack/Documents/workshop/KivyBuilds/dist/hostpython3/include -I/Users/jack/Desktop/KivyBuilds/dist/hostpython3/include/python3.11 -c src/_imagingft.c -o build/temp.macosx-14.4-arm64-cpython-311/src/_imagingft.o
[DEBUG   ] /tmp/tmp5kp7njm7 -O3 -miphoneos-version-min=9.0 -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64 -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -arch arm64 -g -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include -I/Users/jack/Documents/workshop/KivyBuilds/dist/hostpython3/include -I/Users/jack/Desktop/KivyBuilds/dist/hostpython3/include/python3.11 -c src/_imagingmath.c -o build/temp.macosx-14.4-arm64-cpython-311/src/_imagingmath.o
[DEBUG   ] creating build/temp.macosx-14.4-arm64-cpython-311/src/libImaging
[DEBUG   ] creating build/temp.macosx-14.4-arm64-cpython-311/src/Tk
[DEBUG   ] /tmp/tmp5kp7njm7 -O3 -miphoneos-version-min=9.0 -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64 -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -arch arm64 -g -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include -I/Users/jack/Documents/workshop/KivyBuilds/dist/hostpython3/include -I/Users/jack/Desktop/KivyBuilds/dist/hostpython3/include/python3.11 -c src/Tk/tkImaging.c -o build/temp.macosx-14.4-arm64-cpython-311/src/Tk/tkImaging.o
[DEBUG   ] /tmp/tmp5kp7njm7 -O3 -miphoneos-version-min=9.0 -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64 -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -arch arm64 -g -DHAVE_LIBJPEG -DHAVE_LIBZ -DPILLOW_VERSION=\"8.2.0\" -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include -I/Users/jack/Documents/workshop/KivyBuilds/dist/hostpython3/include -I/Users/jack/Desktop/KivyBuilds/dist/hostpython3/include/python3.11 -c src/_imaging.c -o build/temp.macosx-14.4-arm64-cpython-311/src/_imaging.o
[DEBUG   ] In file included from src/Tk/tkImaging.csrc/_imaging.c:src/_imagingft.c:42:75:
[DEBUG   ] 22src/_imagingmath.c:In file included from ::10src/Tk/../libImaging/Imaging.h16:::10:10 :fatal error:  'Python.h' file not foundfatal error: 
[DEBUG   ] 'Python.h' file not found
[DEBUG   ]  13fatal error: #include "Python.h"'Python.h' file not found:
[DEBUG   ] 
[DEBUG   ] #include "Python.h"         ^~~~~~~~~~
[DEBUG   ] 
[DEBUG   ]          ^~~~~~~~~~src/Tk/../libImaging/ImPlatform.h
[DEBUG   ] 
[DEBUG   ] :10:10:#include "Python.h"
[DEBUG   ]          ^~~~~~~~~~
[DEBUG   ]  fatal error: 'Python.h' file not found
[DEBUG   ] #include "Python.h"
[DEBUG   ]          ^~~~~~~~~~
[DEBUG   ] 1 error generated.
[DEBUG   ] building 'PIL._imagingmorph' extension
[DEBUG   ] /tmp/tmp5kp7njm7 -O3 -miphoneos-version-min=9.0 -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64 -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -arch arm64 -g -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl -I/Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include -I/Users/jack/Documents/workshop/KivyBuilds/dist/hostpython3/include -I/Users/jack/Desktop/KivyBuilds/dist/hostpython3/include/python3.11 -c src/_imagingmorph.c -o build/temp.macosx-14.4-arm64-cpython-311/src/_imagingmorph.o
[DEBUG   ] 1 error generated.
[DEBUG   ] 1 error generated.
[DEBUG   ] 1 error generated.
[DEBUG   ] src/_imagingmorph.c:14:10: fatal error: 'Python.h' file not found
[DEBUG   ] #include "Python.h"
[DEBUG   ]          ^~~~~~~~~~
[DEBUG   ] 1 error generated.
[DEBUG   ] error: command '/tmp/tmp5kp7njm7' failed with exit code 1
Exception in thread background thread for pid 86431:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/sh.py", line 1639, in wrap
    fn(*rgs, **kwargs)
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/sh.py", line 2641, in background_thread
    handle_exit_code(exit_code)
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/sh.py", line 2332, in fn
    return self.command.handle_command_exit_code(exit_code)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/sh.py", line 826, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /Users/jack/Documents/workshop/KivyBuilds/dist/hostpython3/bin/python setup.py build_ext --disable-tiff --disable-webp --disable-jpeg2000 --disable-lcms --disable-platform-guessing -g

  STDOUT:
running build_ext
Disabling tiff
Disabling lcms
Disabling webp
Disabling jpeg2000
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/lib/iphoneos
Appending path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
Appending path /A... (13583 more, please see e.stdout)

  STDERR:

Traceback (most recent call last):
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/bin/toolchain", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 1670, in main
    ToolchainCL()
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 1407, in __init__
    getattr(self, args.command)()
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 1483, in build
    build_recipes(args.recipe, ctx)
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 1231, in build_recipes
    recipe.execute()
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 758, in execute
    self.build_all()
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 78, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 858, in build_all
    self.build(plat)
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 78, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 844, in build
    self.build_platform(plat)
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/recipes/pillow/__init__.py", line 51, in build_platform
    shprint(
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 60, in shprint
    for line in cmd:
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/sh.py", line 882, in __next__
    self.wait()
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/sh.py", line 799, in wait
    self.handle_command_exit_code(exit_code)
  File "/Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/sh.py", line 826, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /Users/jack/Documents/workshop/KivyBuilds/dist/hostpython3/bin/python setup.py build_ext --disable-tiff --disable-webp --disable-jpeg2000 --disable-lcms --disable-platform-guessing -g

  STDOUT:
running build_ext
Disabling tiff
Disabling lcms
Disabling webp
Disabling jpeg2000
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/freetype
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/ffi
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/libjpeg
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64/openssl
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/include/iphoneos-arm64
Appending path /Users/jack/Documents/workshop/KivyBuilds/dist/lib/iphoneos
Appending path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
Appending path /A... (13583 more, please see e.stdout)

  STDERR:

Additional context

Any help would be greatly appreciated - thanks!

TanAhm10 commented 6 months ago

in your xcode terminal try 'pip install pillow' this solved a similar problem that I was facing.

the-JACK-pot commented 6 months ago

I'm a little new to Xcode so I'm not too knowledgable about a lot of its features - when you say 'Xcode terminal', do you mean a terminal that's currently executing commands in the App's folder? Or do you mean a terminal within Xcode itself? I'd love if there was a terminal in Xcode, but I've never been able to find one

TanAhm10 commented 6 months ago

@Retr0Hax894 a terminal that's currently executing commands in the App's folder

the-JACK-pot commented 6 months ago

Thanks for the clarification! Unfortunately, however, it doesn't seem to have worked and outputs the same error. Thanks for your suggestion, though! Much appreciated

tcaduser commented 6 months ago

I don't recommend using "sudo" with the toolchain command. Most things can be done as a regular user.

the-JACK-pot commented 6 months ago

Oh really? I figured sudo would have more ability when executing toolchain commands. I tried your suggestion, but it didn't work. I got a different error, and it appeared earlier in the process than the error that appeared when I used 'sudo' in the command.

Here's a snippet of the logs:

RAN: /usr/bin/patch -t -d /Users/jack/Documents/workshop/KivyBuilds/build/pillow/iphoneos-arm64/Pillow-8.2.0 -p1 -i /Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/recipes/pillow/bypass-find-library.patch

  STDOUT:
No file to patch.  Skipping...
1 out of 1 hunks ignored--saving rejects to setup.py.rej

  STDERR:
TanAhm10 commented 6 months ago

It's not building because you're missing a required package or library dependency. Another issue can be the cython version that you're using.

tcaduser commented 6 months ago

Oh really? I figured sudo would have more ability when executing toolchain commands. I tried your suggestion, but it didn't work. I got a different error, and it appeared earlier in the process than the error that appeared when I used 'sudo' in the command.

Here's a snippet of the logs:

RAN: /usr/bin/patch -t -d /Users/jack/Documents/workshop/KivyBuilds/build/pillow/iphoneos-arm64/Pillow-8.2.0 -p1 -i /Users/jack/Documents/workshop/KivyBuilds/tester1/lib/python3.12/site-packages/kivy_ios/recipes/pillow/bypass-find-library.patch

  STDOUT:
No file to patch.  Skipping...
1 out of 1 hunks ignored--saving rejects to setup.py.rej

  STDERR:

You should probably clean up your build directories if you switch from being root (via sudo) to being a regular user. Also I have had trouble in the past with cached downloads being in a bad state. If you don't want to cleanup everything, you can try:

toolchain clean pillow

If you are on an Apple with the arm chip:

toolchain build   --platform iphonesimulator-arm64 pillow

for the simulator and:

toolchain build   --platform iphoneos-arm64 pillow
tcaduser commented 6 months ago

removing my build directory and issuing the following commands worked for me:

rm -rf build
python3 -mvenv kivy_ios_env
source kivy_ios_env/bin/activate
toolchain build  pillow

works for me, including all of the dependencies.

I intentionally have brew nowhere in my path and using the python3 in /usr/bin.

This is the resulting packages built by only specifying pillow.

 % toolchain status
audiostream  - Not built
click        - Not built
curly        - Not built
cymunk       - Not built
ffmpeg       - Not built
ffpyplayer   - Not built
flask        - Not built
freetype     - Build OK (built at 2024-04-25 21:25:41.955863)
hostopenssl  - Build OK (built at 2024-04-25 21:25:53.268592)
hostpython3  - Build OK (built at 2024-04-25 21:28:29.044537)
ios          - Build OK (built at 2024-04-25 21:30:04.582163)
itsdangerous - Not built
jinja2       - Not built
kivent_core  - Not built
kivy         - Not built
kiwisolver   - Not built
libcurl      - Not built
libffi       - Build OK (built at 2024-04-25 21:27:01.358593)
libjpeg      - Build OK (built at 2024-04-25 21:27:12.418917)
libpng       - Not built
libzbar      - Not built
markupsafe   - Not built
materialyoucolor - Not built
matplotlib   - Not built
netifaces    - Not built
numpy        - Not built
openssl      - Build OK (built at 2024-04-25 21:27:34.086948)
photolibrary - Not built
pillow       - Build OK (built at 2024-04-25 21:30:24.951624)
plyer        - Not built
py3dns       - Not built
pycrypto     - Not built
pykka        - Not built
pyobjus      - Not built
python3      - Build OK (built at 2024-04-25 21:29:59.110181)
pyyaml       - Not built
sdl2         - Not built
sdl2_image   - Not built
sdl2_mixer   - Not built
sdl2_ttf     - Not built
werkzeug     - Not built
zbarlight    - Not built
the-JACK-pot commented 6 months ago

Removing the build directory and recreating the virtual environment before building the recipes again (starting with pillow by itself) worked! In fact I was able to build more packages this time!

I believe the issue was both something to do with the venv I had before recreating it, and the fact that I included the sudo command in my toolchain command, e.g. sudo toolchain build pillow - removing sudo seems to have worked wonders, just like the tip for recreating the venv and build project.

Thanks guys! I really appreciate the help

TanAhm10 commented 6 months ago

No Problem, Happy to help!