Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kiwisolver build fails, and depreciation warning #3056

Open
1 task
RobertFlatt opened this issue Aug 24, 2024 · 9 comments
Open
1 task

kiwisolver build fails, and depreciation warning #3056

RobertFlatt opened this issue Aug 24, 2024 · 9 comments

Comments

@RobertFlatt
Copy link
Contributor

Checklist

  • [x ] the issue is indeed a bug and not a support request
  • [x ] issue doesn't already exist: https://github.com/kivy/python-for-android/issues
  • I have a short, runnable example that reproduces the issue
  • [x ] I reproduced the problem with the latest development version (p4a.branch = develop)
  • [ x] I used the grave accent (aka backticks) to format code or logs when appropriated

Description

Kiwisolver build fails with include error.

Also a depreciation warning for next month!

Logs

Error:

creating build
creating build/lib.linux-x86_64-cpython-311
creating build/lib.linux-x86_64-cpython-311/kiwisolver
copying py/kiwisolver/exceptions.py -> build/lib.linux-x86_64-cpython-311/kiwisolver
copying py/kiwisolver/__init__.py -> build/lib.linux-x86_64-cpython-311/kiwisolver
copying py/kiwisolver/_cext.pyi -> build/lib.linux-x86_64-cpython-311/kiwisolver
copying py/kiwisolver/py.typed -> build/lib.linux-x86_64-cpython-311/kiwisolver
running build_ext
building 'kiwisolver._cext' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/py
creating build/temp.linux-x86_64-cpython-311/py/src
/home/bobf/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -DANDROID -I/home/bobf/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/bobf/ex/rtest/.buildozer/android/platform/build-arm64-v8a/build/python-installs/myapp/arm64-v8a/include/python3.1 -fPIC -I/tmp/build-env-dyupwo5o/lib/python3.11/site-packages/cppy/include -I. -I/tmp/build-env-dyupwo5o/include -I/usr/local/include/python3.11 -c py/src/constraint.cpp -o build/temp.linux-x86_64-cpython-311/py/src/constraint.o -std=c++11
In file included from py/src/constraint.cpp:10:
In file included from /tmp/build-env-dyupwo5o/lib/python3.11/site-packages/cppy/include/cppy/cppy.h:16:
/tmp/build-env-dyupwo5o/lib/python3.11/site-packages/cppy/include/cppy/defines.h:10:10: fatal error: 'Python.h' file not found
#include <Python.h>
         ^~~~~~~~~~
1 error generated.
error: command '/home/bobf/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++' failed with exit code 1

Depreciation warning

/tmp/build-env-dyupwo5o/lib/python3.11/site-packages/setuptools_scm/git.py:167: UserWarning: "/home/bobf/ex/rtest/.buildozer/android/platform/build-arm64-v8a/build/other_builds/kiwisolver/arm64-v8a__ndk_target_21/kiwisolver" is shallow and may cause errors
  warnings.warn(f'"{wd.path}" is shallow and may cause errors')
/tmp/build-env-dyupwo5o/lib/python3.11/site-packages/setuptools/dist.py:450: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

        ********************************************************************************
        Usage of dash-separated 'plat-name' will not be supported in future
        versions. Please use the underscore name 'plat_name' instead.

        By 2024-Sep-26, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
        ********************************************************************************

@vabt-igd
Copy link

I am currently experiencing exactly the same issue. I have a feeling that this is something to do with the latest python updates being distributed via the system updater in Ubuntu (22.04 and 24.04), as this problem has only been occurring for the last two weeks and has never happened before.

@RobertFlatt
Copy link
Contributor Author

@T-Dynamos Any suggestions?

@RobertFlatt
Copy link
Contributor Author

@vabt-igd This now builds for me (Ubuntu 22.04), what is your experience?

@vabt-igd
Copy link

vabt-igd commented Aug 29, 2024

Unfortunately, I'm still running into the same issue. Did you change anything about your setup?
I'm using p4a develop with python 3.11.

As far as I can see, there has not been any commit activity on the develop branch of p4a and cppy as well as kiwisolver versions are pinned within the corresponding recipes.

@RobertFlatt
Copy link
Contributor Author

I did an apt update/upgrade. I'd be interested to know if that helps you.

I took looked for p4a develop changes but didn't see anything significant.

@vabt-igd
Copy link

Unfortunately, it does not.
I even tested it on a fresh Ubuntu 22.04 vm with no luck…
Strange issue!

@RobertFlatt
Copy link
Contributor Author

Yes it is. Things magically fixing themselves on one system but not on another is always a bit concerning.

FYI my system Python is 3.10.12 and p4a is using 3.11 internally.

@vabt-igd
Copy link

vabt-igd commented Sep 2, 2024

I tried py 3.10 to 3.12 without any differences regarding the kiwisolver issue.
Did you install any additional packages/modules that may symlink to the python header file Python.h?

@vabt-igd
Copy link

vabt-igd commented Sep 17, 2024

So, I managed to fix the build on my Ubuntu 22.04.4 LTS using Python 3.11.10 (probably Python 3.10 as well, but haven't tested it), p4a develop and custom recipes for cppy and kiwisolver. On Python 3.12 the build still fails.

The custom recipes look as follows:

cppy:

from pythonforandroid.recipe import PythonRecipe


class CppyRecipe(PythonRecipe):
    site_packages_name = "cppy"
    version = "1.2.1"
    url = "https://github.com/nucleic/cppy/archive/{version}.zip"
    call_hostpython_via_targetpython = False
    install_in_hostpython = True
    depends = ["setuptools"]


recipe = CppyRecipe()

Although preferable, I could not get this recipe to properly compile using the PyProjectRecipe...

kiwisolver:

from pythonforandroid.recipe import PyProjectRecipe


class KiwiSolverRecipe(PyProjectRecipe):
    site_packages_name = "kiwisolver"
    version = "1.4.7"
    url = "git+https://github.com/nucleic/kiwi.git"
    depends = ["cppy"]
    hostpython_prerequisites = ["cppy>=1.2.0"]
    need_stl_shared = True


recipe = KiwiSolverRecipe()

I don't think this is worth a PR as there is probably something broken deeper in the build chain either locally on my VMs or in the dev-branch...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants