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

gevent recipe build fail #2805

Closed
RobertFlatt opened this issue May 30, 2023 · 4 comments
Closed

gevent recipe build fail #2805

RobertFlatt opened this issue May 30, 2023 · 4 comments

Comments

@RobertFlatt
Copy link
Contributor

Logs

[1m[90m[DEBUG][39m[0m:   [90m->[0m running python3 setup.py build_ext [0m
[1m[90m[DEBUG][39m[0m:   	Traceback (most recent call last):
[1m[90m[DEBUG][39m[0m:   	  File "/home/bobf/ex/regression/.buildozer/android/platform/build-arm64-v8a/build/other_builds/gevent/arm64-v8a__ndk_target_21/gevent/setup.py", line 46, in <module>
[1m[90m[DEBUG][39m[0m:   	    from _setuplibev import libev_configure_command
[1m[90m[DEBUG][39m[0m:   	  File "/home/bobf/ex/regression/.buildozer/android/platform/build-arm64-v8a/build/other_builds/gevent/arm64-v8a__ndk_target_21/gevent/_setuplibev.py", line 34, in <module>
[1m[90m[DEBUG][39m[0m:   	    " && sh ./configure --host={} ".format(os.environ['TOOLCHAIN_PREFIX']),
[1m[90m[DEBUG][39m[0m:   	  File "/home/bobf/ex/regression/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/Lib/os.py", line 680, in __getitem__
[1m[90m[DEBUG][39m[0m:   	    raise KeyError(key) from None
[1m[90m[DEBUG][39m[0m:   	KeyError: 'TOOLCHAIN_PREFIX'
@AbdulkadirAktuerk
Copy link

did you find any solution to this problem?

@RobertFlatt
Copy link
Contributor Author

No I didn't try.
I was just doing regression testing to see what didn't work. so I didn't care why it didn't work.

It looks like the issue is the the patch https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/recipes/gevent/cross_compiling.patch
It expects TOOLCHAIN_PREFIX to be an environment variable, and it is not.
Seems reasonable this might be related to the NDK toolchain file at least if gevent uses cmake.

But I don't know anything about how gevent is built, so I know that I don't know.

@AndreMiras
Copy link
Member

I could reproduce using the CI here:
https://github.com/kivy/python-for-android/actions/runs/14010021876/job/39228625376
Truncated log:

sh.ErrorReturnCode_1: 
  RAN: /home/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v
  STDOUT:
Traceback (most recent call last):
  File "/home/user/.local/share/python-for-android/build/other_builds/gevent/x86__ndk_target_24/gevent/setup.py", line 46, in <module>
    from _setuplibev import libev_configure_command
  File "/home/user/.local/share/python-for-android/build/other_builds/gevent/x86__ndk_target_24/gevent/_setuplibev.py", line 34, in <module>
    " && sh ./configure --host={} ".format(os.environ['TOOLCHAIN_PREFIX']),
                                           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "<frozen os>", line 679, in __getitem__
KeyError: 'TOOLCHAIN_PREFIX'
  STDERR:
[INFO]:    STDOUT:
	Traceback (most recent call last):	
  File "/home/user/.local/share/python-for-android/build/other_builds/gevent/x86__ndk_target_24/gevent/setup.py", line 46, in <module>	
    from _setuplibev import libev_configure_command	
  File "/home/user/.local/share/python-for-android/build/other_builds/gevent/x86__ndk_target_24/gevent/_setuplibev.py", line 34, in <module>	
    " && sh ./configure --host={} ".format(os.environ['TOOLCHAIN_PREFIX']),	
                                           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^	
  File "<frozen os>", line 679, in __getitem__	
KeyError: 'TOOLCHAIN_PREFIX'

I'm not sure when this environment variable was removed, but the fix is fairly simple, you can simply recreate the environment variable within the get_recipe_env() method.
However this recipe is mapped to an old gevent version (1.4.0) released in January 2019, that's 7 years ago.
I'll try to update it to a more recent version when I get a chance

AndreMiras added a commit that referenced this issue Mar 22, 2025
Update the gevent recipe from 1.4.0 (2019/01) to the latest version
24.11.1 (2024/11) and fix the build errors.
AndreMiras added a commit that referenced this issue Mar 22, 2025
Update the gevent recipe from 1.4.0 (2019/01) to the latest version
24.11.1 (2024/11) and fix the build errors.
@AndreMiras
Copy link
Member

I got it building successfully locally and I've opened a PR #3129

AndreMiras added a commit that referenced this issue Mar 23, 2025
🐛 Upgrade and fix gevent recipe, closes #2805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants