Closed the-JACK-pot closed 6 months ago
Hey, does anybody have an idea on how to fix this? Having the same problem.
it looks like there are some header files missing, like curses.h
. Maybe some stuff didn't get downloaded and the build system thinks it did (caching). Maybe you can clean out the build directories and start over. I think "toolchain clean" might work.
it looks like there are some header files missing, like
curses.h
. Maybe some stuff didn't get downloaded and the build system thinks it did (caching). Maybe you can clean out the build directories and start over. I think "toolchain clean" might work.
Thanks for the reply. I did as you suggested, however the output is the same as before and the toolchain status remains unchanged. The error log suggests that 3 packages (_gdbm
, _tkinter
, and ossaudiodev
) weren't found and therefore not built, however I found all 3 within the 'Modules' folder located inside the python3 folder belonging to the main build folder. I don't suppose that could be the root of the problem? I've never used the C language or C++ language so my knowledge with those files is limited
Edit: In case it helps, I tried toolchain clean
and then toolchain build kivy
in both the regular terminal and then the Rosetta Terminal, both resulting in the same output and same toolchain status output
I bet the real issue is here:
[DEBUG ] ld: building for 'iOS-simulator', but linking in dylib (/usr/local/Cellar/libb2/0.98.1/lib/libb2.1.dylib) built for 'macOS'
[DEBUG ] ld: building for 'iOS-simulator', but linking in dylib (/usr/local/Cellar/libb2/0.98.1/lib/libb2.1.dylib) built for 'macOS'
[DEBUG ] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[DEBUG ] clang: error: linker command failed with exit code 1 (use -v to see invocation)
Also I see compilation errors:
[DEBUG ] /Users/apollov/work/RiftWizard/RiftWizard/.buildozer/ios/platform/kivy-ios/build/python3/iphonesimulator-x86_64/Python-3.11.6/Modules/_multiprocessing/semaphore.c:355:23: error: call to undeclared function 'sem_timedwait'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
[DEBUG ] res = sem_timedwait(self->handle, &deadline);
[DEBUG ] ^
[DEBUG ] /Users/apollov/work/RiftWizard/RiftWizard/.buildozer/ios/platform/kivy-ios/build/python3/iphonesimulator-x86_64/Python-3.11.6/Modules/_multiprocessing/semaphore.c:355:23: note: did you mean 'sem_trywait'?
[DEBUG ] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.2.sdk/usr/include/sys/semaphore.h:58:5: note: 'sem_trywait' declared here
[DEBUG ] int sem_trywait(sem_t *);
[DEBUG ] ^
[DEBUG ] 1 error generated.
And there are more errors up there building various parts.
Got same issue, will try to figure out where should the actual linking target be.
I too have encountered the same error, disappointed to see no response from the repo managers yet. Hope we'll have a solid resolution soon.
it looks like it is in a bad state where not all of the packages got downloaded as part of the build process. are you on an Intel or arm64 build machine? i can only test on arm64.
I am on Intel. @tcaduser, is it the same behaviour with you too?
I'm using an arm64 machine (M2 Apple chip), however I tried this on a Rosetta terminal to emulate an intel machine and I got the same error response
@Retr0Hax894, does it work on M2 macs?
I got a clean build on a m2 macbook from the terminal using these commands:
python3 -mvenv venv
source venv/bin/activate
pip install kivy-ios
toolchain build python3
I am facing that issue on a M2. Got it working on a M3. Both with kivy-ios 2024.3.17 Cython 3.0.0 Python 3.11.6
.
I suspect that the problem is that I did not manage to proper purge all old kivy-ios and toolchain components. - There was a lot of installing, distcleaning and uninstalling in different directories involved - at some stage I had conflicts due to two build folders in different directories. Also facing buggy behaviour needing to rename XCode while the build, which is not an issue on my M3 with a cleaner installation.
Here a cut-out from the logs:
[DEBUG ] running build_scripts [DEBUG ] creating build/scripts-3.11 [DEBUG ] copying and adjusting /Users/v/code/build/python3/iphoneos-arm64/Python-3.11.6/Tools/scripts/pydoc3 -> build/scripts-3.11 [DEBUG ] copying and adjusting /Users/v/code/build/python3/iphoneos-arm64/Python-3.11.6/Tools/scripts/idle3 -> build/scripts-3.11 [DEBUG ] copying and adjusting /Users/v/code/build/python3/iphoneos-arm64/Python-3.11.6/Tools/scripts/2to3 -> build/scripts-3.11 [DEBUG ] changing mode of build/scripts-3.11/pydoc3 from 644 to 755 [DEBUG ] changing mode of build/scripts-3.11/idle3 from 644 to 755 [DEBUG ] changing mode of build/scripts-3.11/2to3 from 644 to 755 [DEBUG ] renaming build/scripts-3.11/pydoc3 to build/scripts-3.11/pydoc3.11 [DEBUG ] renaming build/scripts-3.11/idle3 to build/scripts-3.11/idle3.11 [DEBUG ] renaming build/scripts-3.11/2to3 to build/scripts-3.11/2to3-3.11 Exception in thread background thread for pid 45241: Traceback (most recent call last): File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 982, in run self._target(*self._args, *self._kwargs) File "/Users/v/my_venv/lib/python3.11/site-packages/sh.py", line 1639, in wrap fn(rgs, **kwargs) File "/Users/v/my_venv/lib/python3.11/site-packages/sh.py", line 2641, in background_thread handle_exit_code(exit_code) File "/Users/v/my_venv/lib/python3.11/site-packages/sh.py", line 2332, in fn return self.command.handle_command_exit_code(exit_code) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/v/my_venv/lib/python3.11/site-packages/sh.py", line 826, in handle_command_exit_code raise exc sh.ErrorReturnCode_2:
RAN: /usr/bin/make -j8 'CFLAGS=-O3 -miphoneos-version-min=9.0 -I/Users/v/code/dist/include/iphoneos-arm64/ffi -I/Users/v/code/dist/include/common/libpng -I/Users/v/code/dist/include/iphoneos-arm64/openssl -I/Users/v/code/dist/include/common/sdl2 -I/Users/v/code/dist/include/common/sdl2_image -I/Users/v/code/dist/include/common/sdl2_mixer -I/Users/v/code/dist/include/common/sdl2_ttf -I/Users/v/code/dist/include/iphoneos-arm64 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk'
STDOUT: Makefile:2823: warning: overriding commands for target
Modules/expat/xmlparse.o' Makefile:1031: warning: ignoring old commands for target
Modules/expat/xmlparse.o' Makefile:2824: warning: overriding commands for targetModules/expat/xmlrole.o' Makefile:1034: warning: ignoring old commands for target
Modules/expat/xmlrole.o' Makefile:2825: warning: overriding commands for targetModules/expat/xmltok.o' Makefile:1037: warning: ignoring old commands for target
Modules/expat/xmltok.o' /var/folders/8h/3nl4f07n02s8n9dx1_6rzq_w0000gp/T/tmpm8psgg1h -c -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -O3 -miphoneos-version-min=9.0 -I/Users/v/code/dist/include/iphoneos-arm64/ffi -I/Users/v/code/dist/include/comm... (497963 more, please see e.stdout)STDERR:
Traceback (most recent call last): File "/Users/v/my_venv/bin/toolchain", line 8, in
sys.exit(main()) ^^^^^^ File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/toolchain.py", line 1670, in main ToolchainCL() File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/toolchain.py", line 1407, in init getattr(self, args.command)() File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/toolchain.py", line 1483, in build build_recipes(args.recipe, ctx) File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/toolchain.py", line 1231, in build_recipes recipe.execute() File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/toolchain.py", line 758, in execute self.build_all() File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/toolchain.py", line 78, in _cache_execution f(self, *args, *kwargs) File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/toolchain.py", line 858, in build_all self.build(plat) File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/toolchain.py", line 78, in _cache_execution f(self, args, **kwargs) File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/toolchain.py", line 844, in build self.build_platform(plat) File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/recipes/python3/init.py", line 117, in build_platform shprint(sh.make, self.ctx.concurrent_make, "CFLAGS={}".format(build_env["CFLAGS"])) File "/Users/v/my_venv/lib/python3.11/site-packages/kivy_ios/toolchain.py", line 60, in shprint for line in cmd: File "/Users/v/my_venv/lib/python3.11/site-packages/sh.py", line 882, in next self.wait() File "/Users/v/my_venv/lib/python3.11/site-packages/sh.py", line 799, in wait self.handle_command_exit_code(exit_code) File "/Users/v/my_venv/lib/python3.11/site-packages/sh.py", line 826, in handle_command_exit_code raise exc sh.ErrorReturnCode_2: RAN: /usr/bin/make -j8 'CFLAGS=-O3 -miphoneos-version-min=9.0 -I/Users/v/code/dist/include/iphoneos-arm64/ffi -I/Users/v/code/dist/include/common/libpng -I/Users/v/code/dist/include/iphoneos-arm64/openssl -I/Users/v/code/dist/include/common/sdl2 -I/Users/v/code/dist/include/common/sdl2_image -I/Users/v/code/dist/include/common/sdl2_mixer -I/Users/v/code/dist/include/common/sdl2_ttf -I/Users/v/code/dist/include/iphoneos-arm64 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk'
STDOUT: Makefile:2823: warning: overriding commands for target
Modules/expat/xmlparse.o' Makefile:1031: warning: ignoring old commands for target
Modules/expat/xmlparse.o' Makefile:2824: warning: overriding commands for targetModules/expat/xmlrole.o' Makefile:1034: warning: ignoring old commands for target
Modules/expat/xmlrole.o' Makefile:2825: warning: overriding commands for targetModules/expat/xmltok.o' Makefile:1037: warning: ignoring old commands for target
Modules/expat/xmltok.o' /var/folders/8h/3nl4f07n02s8n9dx1_6rzq_w0000gp/T/tmpm8psgg1h -c -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -O3 -miphoneos-version-min=9.0 -I/Users/v/code/dist/include/iphoneos-arm64/ffi -I/Users/v/code/dist/include/comm... (497963 more, please see e.stdout)
Good to hear that it works on M3. Is it possible to build pandas and fastAPI libraries too using Kivy? I'll really appreciate if you can share the static libraries of numpy, pandas and fastAPI with me as I am unable to build those on my mac.
Good to hear that it works on M3. Is it possible to build pandas and fastAPI libraries too using Kivy? I'll really appreciate if you can share the static libraries of numpy, pandas and fastAPI with me as I am unable to build those on my mac.
Not sure what you mean. For pandas and fastapi there are no recipes atm. I would do the pandas calculations with numpy and look for a pure python api package which one can install with for example: toolchain pip install py-pure-client
. Numpy did work for me toolchain build numpy
... Once this problem is fixed.
I was requesting for the output of the toolchain build numpy
, assuming it creates a .a file for numpy or xcframework. If that's the case, then I can directly import it into my project. Would you be kind enough to build that numpy library and share the .a or xcframework file with me.
I was requesting for the output of the
toolchain build numpy
, assuming it creates a .a file for numpy or xcframework. If that's the case, then I can directly import it into my project. Would you be kind enough to build that numpy library and share the .a or xcframework file with me.
Knock yourself out libnumpy.xcframework.zip
I got a clean build on a m2 macbook from the terminal using these commands:
python3 -mvenv venv source venv/bin/activate pip install kivy-ios toolchain build python3
I just cleaned the toolchain, followed those commands, and the error is the same. I don't suppose you know/remember what python version you had at the time?
I got a clean build on a m2 macbook from the terminal using these commands:
python3 -mvenv venv source venv/bin/activate pip install kivy-ios toolchain build python3
I just cleaned the toolchain, followed those commands, and the error is the same. I don't suppose you know/remember what python version you had at the time?
This is using the system Python 3.9.6 in /usr/bin/python3
to create the virtual environment. The hostpython and ios python created is 3.11.6.
./dist/hostpython3/lib/python3.11/config-3.11-darwin/libpython3.11.a
./dist/hostpython3/lib/libpython3.11.a
./dist/xcframework/libpython3.11.xcframework/ios-arm64-simulator/libpython3.11.a
./dist/xcframework/libpython3.11.xcframework/ios-arm64/libpython3.11.a
./dist/lib/iphoneos/libpython3.11.a
./dist/lib/iphonesimulator/libpython3.11.a
I purposely keep /opt/homebrew/bin
out of my path to prevent unexpected executables from being run accidentally.
If you do a cleanup, make sure you removed:
.cache
dist
build
in the directory you executed the toolchain
command. .cache
is hidden in the terminal unless you use ls -a
to reveal it.
% xcode-select -v
xcode-select version 2406.
And I have Xcode 15.3 app installed.
% xcodebuild -showsdks
DriverKit SDKs:
DriverKit 23.4 -sdk driverkit23.4
iOS SDKs:
iOS 17.4 -sdk iphoneos17.4
iOS Simulator SDKs:
Simulator - iOS 17.4 -sdk iphonesimulator17.4
macOS SDKs:
macOS 14.4 -sdk macosx14.4
macOS 14.4 -sdk macosx14.4
Still believe there must be another problem. Could there be anything missing while the cleaning, any environmental variables? Any better way to purge than what I have done?
I am religiously cleaning the three folders @tcaduser mentioned. With toolchain distclean
as well as by hand - didn't help. Pip uninstalled kivy-ios, deleted the whole venv - still the same issue.
It doesn't make sense that the problem is related to the python version. The whole setup on the M2 worked before I decided to start everything from scratch due to another issue.
Anyway:
My xcode-select versions on both computers is 2405, python 3.11.6 & 3.12.2, XCode 15.3 & XCode 15.1, the xcodebuild -showsdks
output is the same as above.
% xcode-select -v xcode-select version 2406.
And I have Xcode 15.3 app installed.
% xcodebuild -showsdks DriverKit SDKs: DriverKit 23.4 -sdk driverkit23.4 iOS SDKs: iOS 17.4 -sdk iphoneos17.4 iOS Simulator SDKs: Simulator - iOS 17.4 -sdk iphonesimulator17.4 macOS SDKs: macOS 14.4 -sdk macosx14.4 macOS 14.4 -sdk macosx14.4
I checked those same commands and I have the exact same SDKs and Xcode-select version.
Although the output logs for each build can be long, I noticed something unusual when it built the _sqlite3
module:
[DEBUG ] ./Modules/_sqlite/connection.c:1172:14: warning: 'sqlite3_create_window_function' is only available on iOS 13.0 or newer [-Wunguarded-availability-new]
[DEBUG ] rc = sqlite3_create_window_function(self->db, name, num_params, flags,
[DEBUG ] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[DEBUG ] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sqlite3.h:5533:16: note: 'sqlite3_create_window_function' has been marked as being introduced in iOS 13.0 here, but the deployment target is iOS 9.0.0
[DEBUG ] SQLITE_API int sqlite3_create_window_function(
[DEBUG ] ^
[DEBUG ] ./Modules/_sqlite/connection.c:1172:14: note: enclose 'sqlite3_create_window_function' in a __builtin_available check to silence this warning
[DEBUG ] rc = sqlite3_create_window_function(self->db, name, num_params, flags,
[DEBUG ] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[DEBUG ] ./Modules/_sqlite/connection.c:1180:14: warning: 'sqlite3_create_window_function' is only available on iOS 13.0 or newer [-Wunguarded-availability-new]
[DEBUG ] rc = sqlite3_create_window_function(self->db, name, num_params, flags,
[DEBUG ] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[DEBUG ] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sqlite3.h:5533:16: note: 'sqlite3_create_window_function' has been marked as being introduced in iOS 13.0 here, but the deployment target is iOS 9.0.0
[DEBUG ] SQLITE_API int sqlite3_create_window_function(
[DEBUG ] ^
[DEBUG ] ./Modules/_sqlite/connection.c:1180:14: note: enclose 'sqlite3_create_window_function' in a __builtin_available check to silence this warning
[DEBUG ] rc = sqlite3_create_window_function(self->db, name, num_params, flags,
[DEBUG ] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[DEBUG ] ./Modules/_sqlite/connection.c:2109:26: warning: 'sqlite3_serialize' is only available on iOS 12.0 or newer [-Wunguarded-availability-new]
[DEBUG ] data = (const char *)sqlite3_serialize(self->db, name, &size, flags);
[DEBUG ] ^~~~~~~~~~~~~~~~~
[DEBUG ] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sqlite3.h:10281:27: note: 'sqlite3_serialize' has been marked as being introduced in iOS 12.0 here, but the deployment target is iOS 9.0.0
[DEBUG ] SQLITE_API unsigned char *sqlite3_serialize(
[DEBUG ] ^
[DEBUG ] ./Modules/_sqlite/connection.c:2109:26: note: enclose 'sqlite3_serialize' in a __builtin_available check to silence this warning
[DEBUG ] data = (const char *)sqlite3_serialize(self->db, name, &size, flags);
[DEBUG ] ^~~~~~~~~~~~~~~~~
[DEBUG ] ./Modules/_sqlite/connection.c:2112:30: warning: 'sqlite3_serialize' is only available on iOS 12.0 or newer [-Wunguarded-availability-new]
[DEBUG ] data = (const char *)sqlite3_serialize(self->db, name, &size, flags);
[DEBUG ] ^~~~~~~~~~~~~~~~~
[DEBUG ] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sqlite3.h:10281:27: note: 'sqlite3_serialize' has been marked as being introduced in iOS 12.0 here, but the deployment target is iOS 9.0.0
[DEBUG ] SQLITE_API unsigned char *sqlite3_serialize(
[DEBUG ] ^
[DEBUG ] ./Modules/_sqlite/connection.c:2112:30: note: enclose 'sqlite3_serialize' in a __builtin_available check to silence this warning
[DEBUG ] data = (const char *)sqlite3_serialize(self->db, name, &size, flags);
[DEBUG ] ^~~~~~~~~~~~~~~~~
[DEBUG ] ./Modules/_sqlite/connection.c:2184:10: warning: 'sqlite3_deserialize' is only available on iOS 12.0 or newer [-Wunguarded-availability-new]
[DEBUG ] rc = sqlite3_deserialize(self->db, name, buf, size, size, flags);
[DEBUG ] ^~~~~~~~~~~~~~~~~~~
[DEBUG ] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sqlite3.h:10338:16: note: 'sqlite3_deserialize' has been marked as being introduced in iOS 12.0 here, but the deployment target is iOS 9.0.0
[DEBUG ] SQLITE_API int sqlite3_deserialize(
[DEBUG ] ^
[DEBUG ] ./Modules/_sqlite/connection.c:2184:10: note: enclose 'sqlite3_deserialize' in a __builtin_available check to silence this warning
[DEBUG ] rc = sqlite3_deserialize(self->db, name, buf, size, size, flags);
[DEBUG ] ^~~~~~~~~~~~~~~~~~~
[DEBUG ] ./Modules/_sqlite/module.c:123:10: warning: 'sqlite3_enable_shared_cache' is deprecated: first deprecated in iOS 5.0 - Not supported [-Wdeprecated-declarations]
[DEBUG ] rc = sqlite3_enable_shared_cache(do_enable);
[DEBUG ] ^
[DEBUG ] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sqlite3.h:6872:16: note: 'sqlite3_enable_shared_cache' has been explicitly marked deprecated here
[DEBUG ] SQLITE_API int sqlite3_enable_shared_cache(int);
[DEBUG ]
Seems to be an error regarding the iOS deployment target - I know how to change that when an Xcode project is made, but how do I change that when building Kivy?
Also I discovered the following error too, which relates to one of the files mentioned at the end of the log (Modules/expat/xmlparse.o
) so I'm including that error here too, in case it's of any usefulness:
[DEBUG ] ./Modules/expat/xmlparse.c:3116:9: warning: code will never be executed [-Wunreachable-code]
[DEBUG ] parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
[DEBUG ] ^~~~~~
[DEBUG ] ./Modules/expat/xmlparse.c:3115:16: note: silence by adding parentheses to mark code as explicitly dead
[DEBUG ] else if (0 && parser->m_characterDataHandler)
[DEBUG ] ^
[DEBUG ] /* DISABLES CODE */ ( )
[DEBUG ] ./Modules/expat/xmlparse.c:4059:9: warning: code will never be executed [-Wunreachable-code]
[DEBUG ] parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
[DEBUG ] ^~~~~~
[DEBUG ] ./Modules/expat/xmlparse.c:4058:16: note: silence by adding parentheses to mark code as explicitly dead
[DEBUG ] else if (0 && parser->m_characterDataHandler)
[DEBUG ] ^
[DEBUG ] /* DISABLES CODE */ ( )
Maybe it is something related to:
% xcrun --sdk iphoneos --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk
because toolchain.py
uses this command to set the SDK paths.
I am also getting the same compiler warnings as @Retr0Hax894 for sqlite
and xmlparse
.
It looks like you may have the same problem as issue https://github.com/kivy/kivy-ios/issues/905. I think that somehow the build scripts are getting confused and trying to link against libraries in homebrew
Went on a rampage - reset with xcode-select -r, deleted xcode, deleted CommandLineTools, toolchain distclean, deleted the virtual environment, reinstalled all - same output. 😔 As last resort, taking the dist, .cache and build folders form the other computer worked.
Plus, I could substitute the old workaround of renaming XCode with a new workaround of changing the path from
% xcode-select -p
/Applications/Xcode.app/Contents/Developer
after creating the ios repository and before the first XCode build with
sudo xcode-select --switch /Library/Developer/CommandLineTools
That behavior started once I installed kivy-ios from the master branch before the last release and build matplotlib with toolchain.
Not sure if those two issues are related, but it seems to me as if some left-overs of the old kivy-ios installation or toolchain builds are being missed while the uninstalling.
I just tried to build Kivy again and noticed something interesting in the build logs. Sadly it's too far into the build logs to retrieve, but it was roughly something like: downloading (link to python 3.11.6)
(I do remember that it was specifically version 3.11.6).
I have python 3.12 downloaded. While I can download and use 3.11.6, a PEP document bringing forward the idea of separating python packages based off of the package manager they're installed from, and labelling such packages as being 'externally managed', was put forward to Homebrew. As of February this year, the idea was implemented so that packages were handled per the package manager that installed them, and as such only python 3.12 would be installed from Homebrew so that this change would be universal for all Homebrew users. So while I could change version, it wouldn't work alongside Homebrew. Would changing the python version to be downloaded when building help these python errors?
It looks like you may have the same problem as issue #905. I think that somehow the build scripts are getting confused and trying to link against libraries in homebrew
It took a good while to remove the libb2
package due to various dependencies, but after solving that it has finally built! I don't think I can thank you enough, it's been a very frustrating 3 weeks. I'm glad it's now fixed and I hope this will help anyone else that's stuck in the future.
thanks @tcaduser , and everyone else that contributed to this solution
It looks like you may have the same problem as issue #905. I think that somehow the build scripts are getting confused and trying to link against libraries in homebrew
brew uninstall —ignore-dependencies libb2
Worked for me as well. Still puzzled to why, since libb2 is on that computer since ages and the build ran many times through. But happy it's solved. Thanks @tcaduser
I'm glad it worked out for everyone. It is very surprising that brew can interfere in that way. I've always made sure that brew stays out of my PATH, and used the macOS python instead of the one from homebrew.
I think I am luck, though I know the issue is homebrew libb2 is for mac which should not be included, I do not know how to find a libb2 for ios, the lucky is now I know just remove the libb2 will be ok, tks
thanks for this! anyone knows why uninstalling libb2 this solves it?
Update: I get:
Error: Refusing to uninstall /usr/local/Cellar/libb2/0.98.1 because it is required by ffmpeg, gstreamer, libarchive and tesseract, which are currently installed.
so it doesn't sound like a viable solution
do we have to set CPPFLAGS,CFLAGS,LDFLAGS? if so, any docs on that? I'm on mac intel
thanks for this! anyone knows why uninstalling libb2 this solves it?
Update: I get:
Error: Refusing to uninstall /usr/local/Cellar/libb2/0.98.1 because it is required by ffmpeg, gstreamer, libarchive and tesseract, which are currently installed.
so it doesn't sound like a viable solution
do we have to set CPPFLAGS,CFLAGS,LDFLAGS? if so, any docs on that? I'm on mac intel
One thing you can try is to make sure homebrew is not in your default PATH. Then its version of python packages cannot be found. This could be interfering with all of the other version of python that kivy-ios using.
I would look in your .zshrc .bashrc or .profile to make sure that homebrew is not there.
but isn't homebrew supposed to be the most used package manager on mac? if it's not on PATH, then how would I access it when I want to install anything? I'm a bit confused
or is it more like a workaround to remove it from the PATH temporarily only for the running program (Pycharm in my case)?
You can type the full path to whatever tool you want in the homebrew bin directory. I am just giving something to try. It looks to me like one of the recipes is looking for libbb2 and by finding it in your homebrew installation, is messing up. It is impossible for the compiler for the iOS to use a library compiled for macOS.
brew uninstall libb2
Remove the following folders build dist .cache
.cache is hidden
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
/usr/bin/xcodebuild -showsdks
toolchain build kivy
and tray
What I don't understand is that kivy-ios compiles a hostpython, which should run instead of the one from homebrew? Perhaps the Homebrew python environment is polluting the hostpython environment?
Versions
Describe the bug I have 3 folders which I'm using for this project: A folder dedicated to the python virtual environment, a folder dedicated to the Kivy Builds, and the folder containing the pre-build Kivy app in python. I'm currently trying to toolchain build python3 and Kivy. Regardless of what I try to build, however, the output (as shown below) is always the same.
To Reproduce This is the first time I've ever tried to build a Kivy application for iOS, so I'm afraid I don't know how to help reproduce the problem. Here's the
toolchain status
output:and
toolchain build
output (same output regardless of what is building).Expected behavior The expected behaviour is a completed build, allowing me to convert my python code into an Xcode project.
Logs The following was produced with the command
toolchain build python3
however the response is very similar if not identical to the response from the commandtoolchain build kivy
ortoolchain build python3 kivy
Additional context Currently using Cython==0.29.36 however I also tested it with the current version of Cython==3.0.0 (changed to 3.0.9 earlier today but didn't change the output). Kivy.org iOS page states that Cython=3.0.0 is required, but pip says Cython==0.29.36 is needed for Kivy-ios, so I don't know which to use. I've tried separating the folders from other code files. All three are isolated on my desktop and still no change. After activating the venv, all three folders clearly use the python environment located in the environments folder.
Any and all help is greatly appreciated thanks in advance! TLDR: Issue resolved by making sure libb2 installed by brew(due to packages like ffmpeg is interfering, remove it! or make sure it does not get picked in path.)