Open lukieh2014 opened 3 days ago
Hello,
I have the same problem on the MacBook Air M2.
MacOS 15.0 Xcode 16
Exception in thread background thread for pid 6408:
Traceback (most recent call last):
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/threading.py", line 1052, in _bootstrap_inner
self.run()
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/threading.py", line 989, in run
self._target(*self._args, **kwargs)
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sh.py", line 1639, in wrap
fn(*rgs, **kwargs)
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sh.py", line 2641, in background_thread
handle_exit_code(exit_code)
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sh.py", line 2332, in fn
return self.command.handle_command_exit_code(exit_code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sh.py", line 826, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /Users/[REDACTED]/.pyenv/versions/3.12.0/bin/python3 generate-darwin-source-and-headers.py --only-ios
STDOUT:
Skipping i386
checking build system type... aarch64-apple-darwin24.0.0
checking host system type... x86_64-apple-darwin13
checking target system type... x86_64-apple-darwin13
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-apple-darwin13-strip... no
checking for strip... strip
checking for a race-free mkdir -p... ../install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for x86_64-apple-darwin13-gcc... xcrun -sdk iphonesimulator clang -target x86_64-apple-ios-simulator
chec... (21197 more, please see e.stdout)
STDERR:
Traceback (most recent call last):
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/bin/toolchain", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 1670, in main
ToolchainCL()
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 1407, in __init__
getattr(self, args.command)()
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 1483, in build
build_recipes(args.recipe, ctx)
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 1231, in build_recipes
recipe.execute()
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 758, in execute
self.build_all()
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 78, in _cache_execution
f(self, *args, **kwargs)
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 858, in build_all
self.build(plat)
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 78, in _cache_execution
f(self, *args, **kwargs)
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 844, in build
self.build_platform(plat)
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/recipes/libffi/__init__.py", line 29, in build_platform
shprint(python3, "generate-darwin-source-and-headers.py", "--only-ios")
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/kivy_ios/toolchain.py", line 60, in shprint
for line in cmd:
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sh.py", line 882, in __next__
self.wait()
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sh.py", line 799, in wait
self.handle_command_exit_code(exit_code)
File "/Users/[REDACTED]/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sh.py", line 826, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /Users/[REDACTED]/.pyenv/versions/3.12.0/bin/python3 generate-darwin-source-and-headers.py --only-ios
STDOUT:
Skipping i386
checking build system type... aarch64-apple-darwin24.0.0
checking host system type... x86_64-apple-darwin13
checking target system type... x86_64-apple-darwin13
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-apple-darwin13-strip... no
checking for strip... strip
checking for a race-free mkdir -p... ../install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for x86_64-apple-darwin13-gcc... xcrun -sdk iphonesimulator clang -target x86_64-apple-ios-simulator
chec... (21197 more, please see e.stdout)
STDERR:
Can no longer perform a toolchain build process.
Is there already a solution for this?
Best regards
I am seeing the same issue. It looks like it is occuring in the libffi recipe build.
[DEBUG ] clang: error: unsupported option '-print-multi-os-directory'
[DEBUG ] clang: error: no input files
Additional errors I am seeing in the libffi config.log
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:4555: $? = 0
configure:4544: xcrun -sdk iphoneos clang -target armv7-apple-ios -v >&5
Apple clang version 16.0.0 (clang-1600.0.26.3)
Target: armv7-apple-ios
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:4555: $? = 0
configure:4544: xcrun -sdk iphoneos clang -target armv7-apple-ios -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:4555: $? = 1
configure:4544: xcrun -sdk iphoneos clang -target armv7-apple-ios -qversion >&5
clang: error: unknown argument '-qversion'; did you mean '--version'?
clang: error: no input files
configure:4555: $? = 1
configure:4544: xcrun -sdk iphoneos clang -target armv7-apple-ios -version >&5
clang: error: unknown argument '-version'; did you mean '--version'?
clang: error: no input files
configure:4555: $? = 1
configure:4575: checking whether the C compiler works
configure:4597: xcrun -sdk iphoneos clang -target armv7-apple-ios -miphoneos-version-min=9.0 -fembed-bitcode conftest.c >&5
ld: warning: -bitcode_bundle is no longer supported and will be ignored
ld: -mllvm and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:4601: $? = 1
Applying this patch fixes the libffi build:
diff --git a/kivy_ios/recipes/libffi/__init__.py b/kivy_ios/recipes/libffi/__init__.py
index 504280b..5b061e7 100644
--- a/kivy_ios/recipes/libffi/__init__.py
+++ b/kivy_ios/recipes/libffi/__init__.py
@@ -22,6 +22,10 @@ class LibffiRecipe(Recipe):
"-i.bak",
"s/build_target(ios_simulator_i386_platform, platform_headers)/print('Skipping i386')/g",
"generate-darwin-source-and-headers.py")
+ shprint(sh.sed,
+ "-i.bak",
+ "s/ -fembed-bitcode//g",
+ "generate-darwin-source-and-headers.py")
self.set_marker("patched")
def build_platform(self, plat):
And now SDL_ttf
is broken.
[DEBUG ] /Users/jsanchez/git/tmp/build/sdl2_ttf/iphoneos-arm64/SDL2_ttf-2.20.2/external/harfbuzz/src/hb-ft.cc:759:73: error:
[DEBUG ] cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to
[DEBUG ] 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible
[DEBUG ] function type [-Werror,-Wcast-function-type-strict]
[DEBUG ] 759 | ...!= (FT_Generic_Finalizer) hb_ft_face_finalize))
[DEBUG ] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[DEBUG ] In file included from /Users/jsanchez/git/tmp/build/sdl2_ttf/iphoneos-arm64/SDL2_ttf-2.20.2/external/harfbuzz/src/hb-ft.cc:30:
[DEBUG ] /Users/jsanchez/git/tmp/build/sdl2_ttf/iphoneos-arm64/SDL2_ttf-2.20.2/external/harfbuzz/src/hb.hh:260:46: note:
[DEBUG ] expanded from macro 'unlikely'
[DEBUG ] 260 | #define unlikely(expr) (__builtin_expect (!!(expr), 0))
[DEBUG ] | ^~~~
[DEBUG ] /Users/jsanchez/git/tmp/build/sdl2_ttf/iphoneos-arm64/SDL2_ttf-2.20.2/external/harfbuzz/src/hb-ft.cc:765:34: error:
[DEBUG ] cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to
[DEBUG ] 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible
[DEBUG ] function type [-Werror,-Wcast-function-type-strict]
[DEBUG ] 765 | ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
[DEBUG ] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[DEBUG ] /Users/jsanchez/git/tmp/build/sdl2_ttf/iphoneos-arm64/SDL2_ttf-2.20.2/external/harfbuzz/src/hb-ft.cc:1035:32: error:
[DEBUG ] cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to
[DEBUG ] 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible
[DEBUG ] function type [-Werror,-Wcast-function-type-strict]
[DEBUG ] 1035 | ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob;
[DEBUG ] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[DEBUG ] 3 errors generated.
I have the same build problems including identical messages listed previously by others.
Using:
I am working on a patch. It is important to note that homebrew can pollute the python search path, so make sure you remove /opt/homebrew/bin/
from your path.
I am working on a patch. It is important to note that homebrew can pollute the python search path, so make sure you remove
/opt/homebrew/bin/
from your path.
You may be able to get away with
/opt/homebrew/bin/brew uninstall --ignore-dependencies libb2
For context please see Issues #929 #905 #901
For those wanting to try my patch:
git clone --branch fixxc16 https://github.com/tcaduser/kivy-ios
python3 -mvenv venv
source venv/bin/activate
cd kivy-ios
pip install -e .
Then to build:
cd ..
toolchain build kivy
https://www.xcodes.app/ to install / manage multi versions of xcode just use this to install 15.4…
For those wanting to try my patch:
git clone --branch fixxc16 https://github.com/tcaduser/kivy-ios python3 -mvenv venv source venv/bin/activate cd kivy-ios pip install -e .
Then to build:
cd .. toolchain build kivy
This is working for me! the toolchain built successfully, thanks so much !
Hello, I haven't been able to test it yet. Does the fix also work on macos 15.0?
Hello, I haven't been able to test it yet. Does the fix also work on macos 15.0?
It looks like my pull request was accepted and merged into main. It was passing all of the tests on their ci system, so it should be backward compatible.
My change removes a flag that was already deprecated. It also suppresses a new compiler warning.
Thank you! I will check...
Could you please help me?
I just did a clean:
toolchain build kivy
and it built completely for me.
Could it be that we have different errors?
I am working on a patch. It is important to note that homebrew can pollute the python search path, so make sure you remove
/opt/homebrew/bin/
from your path.
Per the guide, I used Homebrew to install pkg-config, libtool, autoconf, and automake. If I remove opt/homebrew/bin from PATH, the toolchain build complains that those items aren't installed. I am new to Mac development... what am I doing wrong? Is there an alternative way to install and reference those dependencies for the toolchain build?
I've only used Homebrew to install those 4 packages. I use the CLT supplied Python with venv and I don't use Homebrew to install/manage Python in any way. In this case, will Homebrew still pollute the Python search path? In my case, when I put opt/homebrew/bin back in PATH, the newly merged main seems to work fine. I'm confused.
Hi @eljarro
There is something going on with the homebrew python packages interfering with kivy-ios. If keeping homebrew in your path is needed, than I suggest doing it. However, it has been found more than once that this may be necessary (#929, #905, #901)
/opt/homebrew/bin/brew uninstall --ignore-dependencies libb2
since this package causes strange build errors. This is even more confusing since kivy-ios builds python
(for iOS?) and hostpython
(for macOS?).
So there are 3 different python versions at play. I personally create my virtual environment using /usr/bin/python3
instead of the one from homebrew.
In the end, I suggest doing what works for you.
1) So is it correct to assume that Homebrew can stay in $PATH as long as Homebrew is NOT used to install Python(s)?
2) If Homebrew path is removed from $PATH, how does “toolchain build python3 kivy” process know where to find the required non-Python dependencies like autoconf, automake, etc?
Much appreciated.
Sent from my iPad
On Sep 25, 2024, at 6:23 PM, Juan Sanchez @.***> wrote:
Hi @eljarrohttps://github.com/eljarro
There is something going on with the homebrew python packages interfering with kivy-ios. If keeping homebrew in your path is needed, than I suggest doing it. However, it has been found more than once that this may be necessary (#929https://github.com/kivy/kivy-ios/issues/929, #905https://github.com/kivy/kivy-ios/issues/905, #901https://github.com/kivy/kivy-ios/issues/901)
/opt/homebrew/bin/brew uninstall --ignore-dependencies libb2
since this package causes strange build errors. This is even more confusing since kivy-ios builds python (for iOS?) and hostpython (for macOS?).
So there are 3 different python versions at play. I personally create my virtual environment using /usr/bin/python3 instead of the one from homebrew.
In the end, I suggest doing what works for you.
— Reply to this email directly, view it on GitHubhttps://github.com/kivy/kivy-ios/issues/936#issuecomment-2375552792, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BCFJNKNULF3UDDDF7CVRTV3ZYNO2JAVCNFSM6AAAAABOY6Y3MWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZVGU2TENZZGI. You are receiving this because you were mentioned.Message ID: @.***>
1) So is it correct to assume that Homebrew can stay in $PATH as long as Homebrew is NOT used to install Python(s)?
I'm thinking that brew may be needed in your path for some packages. I think that libb2
needs to be removed, because it interferes with the build of the target python installed on iOS.
2) If Homebrew path is removed from $PATH, how does “toolchain build python3 kivy” process know where to find the required non-Python dependencies like autoconf, automake, etc? Much appreciated.
I think I got confused, since some packages are not rebuild do to caching, so brew is probably needed.
My impression is that the configure
file is not generated using the autotools. It is patched in the recipes:
./kivy_ios/recipes/python3/configure.patch
or run directly as is:
% grep configure */__init__.py
ffmpeg/__init__.py: configure = sh.Command(join(self.build_dir, "configure"))
ffmpeg/__init__.py: shprint(configure,
freetype/__init__.py: configure = sh.Command(join(self.build_dir, "configure"))
freetype/__init__.py: shprint(configure,
hostopenssl/__init__.py: configure = sh.Command(join(self.build_dir, "Configure"))
hostopenssl/__init__.py: shprint(configure,
hostpython3/__init__.py: configure = sh.Command(join(self.build_dir, "configure"))
hostpython3/__init__.py: shprint(configure,
libcurl/__init__.py: configure = sh.Command(join(self.build_dir, "configure"))
libcurl/__init__.py: shprint(configure,
libjpeg/__init__.py: configure = sh.Command(join(self.build_dir, "configure"))
libjpeg/__init__.py: shprint(configure,
libpng/__init__.py: configure = sh.Command(join(self.build_dir, "configure"))
libpng/__init__.py: shprint(configure,
libzbar/__init__.py: sh.Command('./configure'),
pycrypto/__init__.py: configure = sh.Command(join(self.build_dir, "configure"))
pycrypto/__init__.py: shprint(configure,
python3/__init__.py: self.apply_patch("configure.patch")
python3/__init__.py: configure = sh.Command(join(self.build_dir, "configure"))
python3/__init__.py: shprint(configure,
Apparently only the only recipe I see calling an autotool is libzbar:
% grep auto */__init__.py
libzbar/__init__.py: shprint(sh.Command('autoreconf'), '-vif')
The famous libb2
problem actually requires the pkg-config
command from homebrew to accidentally misconfigure the target python versions.
So I have been wrong about not needing homebrew in your path.
Versions
The 'toolchain build kivy' command does not seem to work with Xcode 16, producing errors shown below.
To Reproduce
cd kivy_project python3.11 -m venv venv . venv/bin/activate pip install kivy-ios toolchain build kivy <- causing errors
I have also tried it with cloning the github, and get the same errors:
Expected behavior A successful build with toolchain.
Logs
Additional context I am on Apple silicon M3 mac, I managed to get a successful build with Xcode 15.2 (after doing brew uninstall libb2), however I don't think that xcode15.2 supports my current IOS version (17.7). After upgrading to Xcode16 (and doing clean runs each time i.e. deleting dist, .cache, build, making new venv, toolchain distclean etc) I am getting the errors above. I think it may be due to the IOS SDK being used (with Xcode16 it is IOS 18) is too new and is unsupported? but not really sure - i am a bit of a noob with this stuff...