kivy / kivy-ios

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

MacOS Mojave libffi build failed #721

Closed moldenha closed 2 years ago

moldenha commented 2 years ago

When building kiv ios, using the command toolchain build python3 kivy I get the error that PhaseScriptExecution Run\ Script /Users/sam/Downloads/interface_app/build/libffi/x86_64/libffi-3.2.1/build/libffi.build/Release-iphonesimulator/libffi-iOS.build/Script-DB13B3051849E01C0010F42D.sh failed, basically the building of libffi. Is there a way to build libffi manually and install it to the build folder? Also, this problem did not happen on MacOS Catalina I recently upgraded to MacOS Mjoave and downgraded the XCode to version 12.5. It also did not work on the latest release of XCode version 13.4. Is there a fix to this?

The entire error is shown below:

DEBUG   ]     /bin/sh -c /Users/sam/Downloads/interface_app/build/libffi/x86_64/libffi-3.2.1/build/libffi.build/Release-iphonesimulator/libffi-iOS.build/Script-DB13B3051849E01C0010F42D.sh
[DEBUG   ] /Users/sam/Downloads/interface_app/build/libffi/x86_64/libffi-3.2.1/build/libffi.build/Release-iphonesimulator/libffi-iOS.build/Script-DB13B3051849E01C0010F42D.sh: line 2: /usr/bin/python: No such file or directory
[DEBUG   ] Command PhaseScriptExecution failed with a nonzero exit code
[DEBUG   ] 
[DEBUG   ] ** BUILD FAILED **
[DEBUG   ] 
[DEBUG   ] 
[DEBUG   ] The following build commands failed:
[DEBUG   ]  PhaseScriptExecution Run\ Script /Users/sam/Downloads/interface_app/build/libffi/x86_64/libffi-3.2.1/build/libffi.build/Release-iphonesimulator/libffi-iOS.build/Script-DB13B3051849E01C0010F42D.sh
[DEBUG   ] (1 failure)
Exception in thread background thread for pid 42524:
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/sh.py", line 1683, in wrap
    fn(*rgs, **kwargs)
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/sh.py", line 2662, in background_thread
    handle_exit_code(exit_code)
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/sh.py", line 2349, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_65: 

  RAN: /usr/bin/xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks=16 ONLY_ACTIVE_ARCH=NO ARCHS=x86_64 BITCODE_GENERATION_MODE=bitcode -sdk iphonesimulator -project libffi.xcodeproj -target libffi-iOS -configuration Release

  STDOUT:
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks=16 ONLY_ACTIVE_ARCH=NO ARCHS=x86_64 BITCODE_GENERATION_MODE=bitcode -sdk iphonesimulator -project libffi.xcodeproj -target libffi-iOS -configuration Release

Build settings from command line:
    ARCHS = x86_64
    BITCODE_GENERATION_MODE = bitcode
    IDEBuildOperationMaxNumberOfConcurrentCompileTasks = 16
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphonesimulator14.4

note: Using new build system
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 5.0, but the range of supported deployment target versions is 9.0 t... (36104 more, please see e.stdout)

  STDERR:

Traceback (most recent call last):
  File "/Users/sam/Downloads/interface_app/venv/bin/toolchain", line 8, in <module>
    sys.exit(main())
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/toolchain.py", line 1555, in main
    ToolchainCL()
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/toolchain.py", line 1299, in __init__
    getattr(self, args.command)()
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/toolchain.py", line 1368, in build
    build_recipes(args.recipe, ctx)
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/toolchain.py", line 1142, in build_recipes
    recipe.execute()
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/toolchain.py", line 704, in execute
    self.build_all()
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/toolchain.py", line 74, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/toolchain.py", line 803, in build_all
    self.build(arch)
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/toolchain.py", line 74, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/toolchain.py", line 790, in build
    self.build_arch(arch)
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/recipes/libffi/__init__.py", line 35, in build_arch
    shprint(sh.xcodebuild, self.ctx.concurrent_xcodebuild,
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/kivy_ios/toolchain.py", line 56, in shprint
    for line in cmd:
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/sh.py", line 953, in next
    self.wait()
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/sh.py", line 879, in wait
    self.handle_command_exit_code(exit_code)
  File "/Users/sam/Downloads/interface_app/venv/lib/python3.8/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_65: 

  RAN: /usr/bin/xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks=16 ONLY_ACTIVE_ARCH=NO ARCHS=x86_64 BITCODE_GENERATION_MODE=bitcode -sdk iphonesimulator -project libffi.xcodeproj -target libffi-iOS -configuration Release

  STDOUT:
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks=16 ONLY_ACTIVE_ARCH=NO ARCHS=x86_64 BITCODE_GENERATION_MODE=bitcode -sdk iphonesimulator -project libffi.xcodeproj -target libffi-iOS -configuration Release

Build settings from command line:
    ARCHS = x86_64
    BITCODE_GENERATION_MODE = bitcode
    IDEBuildOperationMaxNumberOfConcurrentCompileTasks = 16
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphonesimulator14.4

note: Using new build system
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 5.0, but the range of supported deployment target versions is 9.0 t... (36104 more, please see e.stdout)

  STDERR:
misl6 commented 2 years ago

Closing as a duplicated of https://github.com/kivy/kivy-ios/issues/704

Support for macOS 12.3.1 has already been added in https://github.com/kivy/kivy-ios/pull/688

In order to use a development version, please follow this guide: https://github.com/kivy/kivy-ios#development

Feel free to join our Discord Chat if you need some help or advice.