kivy / kivy-ios

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

issue creating recipe for kiwsolver #857

Closed tcaduser closed 9 months ago

tcaduser commented 10 months ago

Versions

Describe the bug

I'm trying to create a recipe for kiwisolver. It fails because it is trying to link a dynamic library, and there are missing symbols for Python and all Python dependencies.

My understanding is that only a static library needs to be created, but it is unclear how to tell the system to do this. The recipe is using setuptools build_ext

To Reproduce Recipe kiwisolver/__init__.py

from kivy_ios.toolchain import CythonRecipe, shprint
from os.path import join
import sh
import shutil

class KiwiSolverRecipe(CythonRecipe):
    site_packages_name = 'kiwisolver'
    version = '1.3.2'
    url = 'https://github.com/nucleic/kiwi/archive/{version}.zip'
    depends = ["python"]
    hostpython_prerequisites = ["cppy",]
    cythonize = False

recipe = KiwiSolverRecipe()

Expected behavior

The build would complete, and the static library would be installed.

Logs

[DEBUG   ] /var/folders/c6/np6v7bqd3cl7nb3zmtb3sd400000gn/T/tmp5ft6r92s -arch arm64 -L/Users/jsanchez/git/tcadapp/app/dist/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/lib -miphoneos-version-min=9.0 -O3 -miphoneos-version-min=9.0 -I/Users/jsanchez/git/tcadapp/app/dist/include/arm64/ffi -I/Users/jsanchez/git/tcadapp/app/dist/include/arm64/openssl -I/Users/jsanchez/git/tcadapp/app/dist/include/arm64 -fembed-bitcode -g build/temp.macosx-13.5-arm64-cpython-310/py/constraint.o build/temp.macosx-13.5-arm64-cpython-310/py/expression.o build/temp.macosx-13.5-arm64-cpython-310/py/kiwisolver.o build/temp.macosx-13.5-arm64-cpython-310/py/solver.o build/temp.macosx-13.5-arm64-cpython-310/py/strength.o build/temp.macosx-13.5-arm64-cpython-310/py/term.o build/temp.macosx-13.5-arm64-cpython-310/py/variable.o -o build/lib.macosx-13.5-arm64-cpython-310/kiwisolver.cpython-310-darwin.so -stdlib=libc++
[DEBUG   ] Undefined symbols for architecture arm64:
[DEBUG   ]   "_PyArg_ParseTuple", referenced from:
[DEBUG   ]       kiwisolver::(anonymous namespace)::Solver_addEditVariable(kiwisolver::Solver*, _object*) in solver.o
[DEBUG   ]       kiwisolver::(anonymous namespace)::Solver_suggestValue(kiwisolver::Solver*, _object*) in solver.o
[DEBUG   ]       kiwisolver::(anonymous namespace)::strength_create(kiwisolver::strength*, _object*) in strength.o
[DEBUG   ]   "_PyArg_ParseTupleAndKeywords", referenced from:
[DEBUG   ]       kiwisolver::(anonymous namespace)::Constraint_new(_typeobject*, _object*, _object*) in constraint.o
[DEBUG   ]       kiwisolver::(anonymous namespace)::Expression_new(_typeobject*, _object*, _object*) in expression.o
[DEBUG   ]       kiwisolver::(anonymous namespace)::Term_new(_typeobject*, _object*, _object*) in term.o
[DEBUG   ]       kiwisolver::(anonymous namespace)::Variable_new(_typeobject*, _object*, _object*) in variable.o
[DEBUG   ]   "_PyDict_Size", referenced from:
[DEBUG   ]       kiwisolver::(anonymous namespace)::Solver_new(_typeobject*, _object*, _object*) in solver.o

Screenshots

Additional context

It looks like this recipe should be able to build. For some reason the hostpython is trying to build the shared object, which requires all symbols to be present.

tcaduser commented 10 months ago

This work is toward fixing Issue #712

tcaduser commented 9 months ago

Finished in PR #858