What is causing the error when I run the "toolchain build python3 openssl kivy" command from the kivy-ios GitHub doc?

Question:

I am using the $ toolchain build python3 openssl kivy command found on the Kivy-ios documentation page on GitHub: https://github.com/kivy/kivy-ios

However, I am getting an error (apologies if the log is very long)- do let me know if I should shorten it, but for completion I included it all:

[INFO    ] Building with 8 processes, where supported
[INFO    ] Want to build ['python3', 'openssl', 'kivy']
[INFO    ] Using the bundled version for recipe 'python3'
[INFO    ] Loaded recipe python3 (depends of ['hostpython3', 'libffi', 'openssl'], optional are [])
[INFO    ] Using the bundled version for recipe 'openssl'
[INFO    ] Loaded recipe openssl (depends of [], optional are [])
[INFO    ] Using the bundled version for recipe 'kivy'
[INFO    ] Loaded recipe kivy (depends of ['sdl2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'ios', 'pyobjus', 'python', 'host_setuptools3'], optional are [])
[INFO    ] Using the bundled version for recipe 'hostpython3'
[INFO    ] Loaded recipe hostpython3 (depends of ['hostopenssl'], optional are [])
[INFO    ] Using the bundled version for recipe 'libffi'
[INFO    ] Loaded recipe libffi (depends of [], optional are [])
[INFO    ] Using the bundled version for recipe 'sdl2'
[INFO    ] Loaded recipe sdl2 (depends of [], optional are [])
[INFO    ] Using the bundled version for recipe 'sdl2_image'
[INFO    ] Loaded recipe sdl2_image (depends of ['sdl2'], optional are [])
[INFO    ] Using the bundled version for recipe 'sdl2_mixer'

….

[DEBUG   ] x freetype-2.5.5/builds/exports.mk
[DEBUG   ] x freetype-2.5.5/builds/ansi/
[DEBUG   ] x freetype-2.5.5/builds/ansi/ansi.mk
[DEBUG   ] x freetype-2.5.5/builds/ansi/ansi-def.mk
[DEBUG   ] x freetype-2.5.5/builds/toplevel.mk
[DEBUG   ] x freetype-2.5.5/vms_make.com
[DEBUG   ] x freetype-2.5.5/autogen.sh
[DEBUG   ] x freetype-2.5.5/ChangeLog.20
[DEBUG   ] x freetype-2.5.5/README.git
[DEBUG   ] x freetype-2.5.5/ChangeLog.21
[INFO    ] Extract freetype for arm64
[INFO    ] Extract /Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/.cache/freetype-freetype-2.5.5.tar.bz2 into /Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/build/freetype/arm64
[INFO    ] Running Shell: /usr/bin/tar ('-C', '/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/build/freetype/arm64', '-xv', '-j', '-f', '/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/.cache/freetype-freetype-2.5.5.tar.bz2') {'_iter': True, '_out_bufsize': 1, '_err_to_out': True}
[DEBUG   ] x freetype-2.5.5/
[DEBUG   ] x freetype-2.5.5/configure
[DEBUG   ] x freetype-2.5.5/ChangeLog
[DEBUG   ] x freetype-2.5.5/docs/
[DEBUG   ] x freetype-2.5.5/docs/TODO
[DEBUG   ] x freetype-2.5.5/include/internal/services/svxf86nm.h
[DEBUG   ] x freetype-2.5.5/include/internal/services/svttcmap.h
[DEBUG   ] x freetype-2.5.5/include/internal/ftmemory.h
[DEBUG   ] x freetype-2.5.5/include/internal/ftrfork.h
[DEBUG   ] x freetype-2.5.5/include/internal/ftcalc.h
[DEBUG   ] x freetype-2.5.5/include/internal/ftpic.h
[DEBUG   ] x freetype-2.5.5/include/internal/ftvalid.h
[DEBUG   ] x freetype-2.5.5/include/internal/ftserv.h
[DEBUG   ] x freetype-2.5.5/include/internal/internal.h
[DEBUG   ] x freetype-2.5.5/include/ftsynth.h
[DEBUG   ] x freetype-2.5.5/builds/cmake/
[DEBUG   ] x freetype-2.5.5/builds/cmake/iOS.cmake
[DEBUG   ] x freetype-2.5.5/builds/link_dos.mk
[DEBUG   ] x freetype-2.5.5/builds/exports.mk
[DEBUG   ] x freetype-2.5.5/builds/ansi/
[DEBUG   ] x freetype-2.5.5/builds/ansi/ansi.mk
[DEBUG   ] x freetype-2.5.5/builds/ansi/ansi-def.mk
[DEBUG   ] x freetype-2.5.5/builds/toplevel.mk
[DEBUG   ] x freetype-2.5.5/vms_make.com
[DEBUG   ] x freetype-2.5.5/autogen.sh
[DEBUG   ] x freetype-2.5.5/ChangeLog.20
[DEBUG   ] x freetype-2.5.5/README.git
[DEBUG   ] x freetype-2.5.5/ChangeLog.21
[DEBUG   ] New State: freetype.extract at 2022-05-15 08:34:27.405911
[INFO    ] Install_hostpython_prerequisites freetype
[DEBUG   ] New State: freetype.install_hostpython_prerequisites at 2022-05-15 08:34:27.406168
[INFO    ] Build_all freetype
[INFO    ] Build freetype for x86_64, arm64 (filtered)
[INFO    ] Build freetype
[INFO    ] Prebuild freetype for x86_64
[DEBUG   ] Invoking prebuild_x86_64
[INFO    ] Build freetype for x86_64
[INFO    ] CC and CXX will not use ccache
[INFO    ] Running Shell: /Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/build/freetype/x86_64/freetype-2.5.5/configure ('CC=/tmp/tmpe673up5w', 'LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld', 'CFLAGS=-O3 -miphoneos-version-min=9.0 -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64/freetype -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64/ffi -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64/openssl -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2 -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2_image -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2_mixer -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2_ttf -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64', 'LDFLAGS=-arch x86_64 -L/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.4.sdk/usr/lib -miphoneos-version-min=9.0', '--prefix=/', '--host=x86_64-apple-darwin13', '--without-png', '--without-bzip2', '--without-fsspec', '--without-harfbuzz', '--without-old-mac-fonts', '--enable-static=yes', '--enable-shared=no') {'_iter': True, '_out_bufsize': 1, '_err_to_out': True}
[DEBUG   ] ls: /Users/patrickchong/Desktop/Personal: No such file or directory
[DEBUG   ] ls: Projects/Text: No such file or directory
[DEBUG   ] ls: app/kivy-ios/build/freetype/x86_64/freetype-2.5.5: No such file or directory
[DEBUG   ] ls: messanger: No such file or directory
[DEBUG   ] ls: /Users/patrickchong/Desktop/Personal: No such file or directory
[DEBUG   ] ls: Projects/Text: No such file or directory
[DEBUG   ] ls: app/kivy-ios/build/freetype/x86_64/freetype-2.5.5: No such file or directory
[DEBUG   ] ls: messanger: No such file or directory
[DEBUG   ] /Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/build/freetype/x86_64/freetype-2.5.5/configure: line 100: test: too many arguments
[DEBUG   ] Generating `Makefile'
[DEBUG   ] Makefile:7: /Users/patrickchong/Desktop/Personal: No such file or directory
[DEBUG   ] Makefile:7: Projects/Text: No such file or directory
[DEBUG   ] Makefile:7: messanger: No such file or directory
[DEBUG   ] Makefile:7: app/kivy-ios/build/freetype/x86_64/freetype-2.5.5/Makefile: No such file or directory
[DEBUG   ] make: *** No rule to make target `app/kivy-ios/build/freetype/x86_64/freetype-2.5.5/Makefile'.  Stop.
Exception in thread background thread for pid 89656:
Traceback (most recent call last):
  File "/Users/patrickchong/opt/anaconda3/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/Users/patrickchong/opt/anaconda3/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/sh.py", line 1683, in wrap
    fn(*rgs, **kwargs)
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/sh.py", line 2662, in background_thread
    handle_exit_code(exit_code)
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/sh.py", line 2349, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: '/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/build/freetype/x86_64/freetype-2.5.5/configure' CC=/tmp/tmpe673up5w LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld 'CFLAGS=-O3 -miphoneos-version-min=9.0 -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64/freetype -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64/ffi -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64/openssl -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2 -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2_image -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2_mixer -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2_ttf -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64' 'LDFLAGS=-arch x86_64 -L/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.4.sdk/usr/lib -miphoneos-version-min=9.0' --prefix=/ --host=x86_64-apple-darwin13 --without-png --without-bzip2 --without-fsspec --without-harfbuzz --without-old-mac-fonts --enable-static=yes --enable-shared=no

  STDOUT:
ls: /Users/patrickchong/Desktop/Personal: No such file or directory
ls: Projects/Text: No such file or directory
ls: app/kivy-ios/build/freetype/x86_64/freetype-2.5.5: No such file or directory
ls: messanger: No such file or directory
ls: /Users/patrickchong/Desktop/Personal: No such file or directory
ls: Projects/Text: No such file or directory
ls: app/kivy-ios/build/freetype/x86_64/freetype-2.5.5: No such file or directory
ls: messanger: No such file or directory
/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/build/freetype/x86_64/freetype-2.5.5/configure: line 100: test: too many arguments
Generating `Makefile'
Makefile:7: /Users/patrickchong/Desktop/Personal: No such file or directory
Makefile:7: Projects/Text... (277 more, please see e.stdout)

  STDERR:

Traceback (most recent call last):
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/bin/toolchain", line 10, in <module>
    sys.exit(main())
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 1555, in main
    ToolchainCL()
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 1299, in __init__
    getattr(self, args.command)()
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 1368, in build
    build_recipes(args.recipe, ctx)
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 1142, in build_recipes
    recipe.execute()
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 704, in execute
    self.build_all()
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 74, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 803, in build_all
    self.build(arch)
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 74, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 790, in build
    self.build_arch(arch)
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/recipes/freetype/__init__.py", line 16, in build_arch
    shprint(configure,
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 56, in shprint
    for line in cmd:
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/sh.py", line 953, in next
    self.wait()
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/sh.py", line 879, in wait
    self.handle_command_exit_code(exit_code)
  File "/Users/patrickchong/Desktop/Personal Projects/Text messanger app/venv/lib/python3.9/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: '/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/build/freetype/x86_64/freetype-2.5.5/configure' CC=/tmp/tmpe673up5w LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld 'CFLAGS=-O3 -miphoneos-version-min=9.0 -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64/freetype -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64/ffi -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64/openssl -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2 -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2_image -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2_mixer -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/common/sdl2_ttf -I/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/include/x86_64' 'LDFLAGS=-arch x86_64 -L/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/dist/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.4.sdk/usr/lib -miphoneos-version-min=9.0' --prefix=/ --host=x86_64-apple-darwin13 --without-png --without-bzip2 --without-fsspec --without-harfbuzz --without-old-mac-fonts --enable-static=yes --enable-shared=no

  STDOUT:
ls: /Users/patrickchong/Desktop/Personal: No such file or directory
ls: Projects/Text: No such file or directory
ls: app/kivy-ios/build/freetype/x86_64/freetype-2.5.5: No such file or directory
ls: messanger: No such file or directory
ls: /Users/patrickchong/Desktop/Personal: No such file or directory
ls: Projects/Text: No such file or directory
ls: app/kivy-ios/build/freetype/x86_64/freetype-2.5.5: No such file or directory
ls: messanger: No such file or directory
/Users/patrickchong/Desktop/Personal Projects/Text messanger app/kivy-ios/build/freetype/x86_64/freetype-2.5.5/configure: line 100: test: too many arguments
Generating `Makefile'
Makefile:7: /Users/patrickchong/Desktop/Personal: No such file or directory
Makefile:7: Projects/Text... (277 more, please see e.stdout)

  STDERR:

I have omitted many of the ‘DEBUG’ lines above, as I thought it was unecessary and there was not enough space to share it, but happy to do so if it helps!

Any suggestions on what is going wrong and how I can fix it? Based on the output I gather it is looking for a directory or file and not finding one?

Asked By: Patrick_Chong

||

Answers:

Looks like you have spaces in your project path and they are not being handled correctly.

[DEBUG ] ls: /Users/patrickchong/Desktop/Personal: No such file or
directory [DEBUG ] ls: Projects/Text: No such file or directory
[DEBUG ] ls: app/kivy-ios/build/freetype/x86_64/freetype-2.5.5: No
such file or directory [DEBUG ] ls: messanger: No such file or
directory [DEBUG ] ls: /Users/patrickchong/Desktop/Personal: No such
file or directory [DEBUG ] ls: Projects/Text: No such file or
directory [DEBUG ] ls:
app/kivy-ios/build/freetype/x86_64/freetype-2.5.5: No such file or
directory [DEBUG ] ls: messanger: No such file or directory

You might either change the path to project to not contain spaces or try to deal with spaces escaping in the code. I’d do the former, because it’s simpler.

Sorry for potential necroposting 🙂

Answered By: apollov

I was in Python 3 path. After restarting the terminal and returning to home dir, the toolchain command worked.

Answered By: harshith7823
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.