Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make CI compile aiohttp again.#2690

Merged
AndreMiras merged 5 commits intokivy:developfrom
xavierfiechter:develop
Oct 20, 2022
Merged

Make CI compile aiohttp again.#2690
AndreMiras merged 5 commits intokivy:developfrom
xavierfiechter:develop

Conversation

Copy link
Contributor

xavierfiechter commented Oct 19, 2022

xavierfiechter mentioned this pull request Oct 19, 2022
AndreMiras reviewed Oct 19, 2022
Copy link
Member

AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, I left a comment regarding the recipe URL

version = "v3.6.2"
url = "https://github.com/aio-libs/aiohttp/archive/{version}.zip"
class AIOHTTPRecipe(CppCompiledComponentsPythonRecipe): # type: ignore # pylint: disable=R0903
url = "https://files.pythonhosted.org/packages/ff/4f/62d9859b7d4e6dc32feda67815c5f5ab4421e6909e48cbc970b6a40d60b7/aiohttp-3.8.3.tar.gz"
Copy link
Member

AndreMiras Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update that line to leverage the version variable, and also use the github url?
Like so:

version = "3.8.3"
url = "https://github.com/aio-libs/aiohttp/archive/v{version}.zip"

xavierfiechter reacted with thumbs up emoji
AndreMiras previously approved these changes Oct 19, 2022
Copy link
Member

AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Xavier, I'll merge when the CI turns green for this recipe

AndreMiras reviewed Oct 19, 2022
Comment on lines +17 to 18
return env

Copy link
Member

AndreMiras Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flake8 is expecting an extra line here, CI is complaining:

pythonforandroid/recipes/aiohttp/__init__.py:19:1: E305 expected 2 blank lines after class or function definition, found 1

xavierfiechter dismissed AndreMiras's stale review via 6dee3ab October 19, 2022 12:18
Copy link
Member

AndreMiras commented Oct 19, 2022

It seems like the recipe failed in the CI with the following:

running python3 setup.py clean --all stty: stdin isn't a terminal [INFO]: -> running python3 setup.py build_ext -v Exception in thread background thread for pid 77842: Traceback (most recent call last): File "/usr/local/Cellar/python@3.10/3.10.7/Frameworks/Python.fram ework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/local/Cellar/python@3.10/3.10.7/Frameworks/Python.fram ework/Versions/3.10/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 1641, in wrap fn(*rgs, **kwargs) File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 2569, in background_thread handle_exit_code(exit_code) File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line [2269](https://github.com/kivy/python-for-android/actions/ru ns/3281492031/jobs/5404298939#step:6:2270), in fn return self.command.handle_command_exit_code(exit_code) File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code raise exc sh.ErrorReturnCode_1: RAN: /Users/runner/.python-for-android/build/other_builds/hostpyt hon3/desktop/hostpython3/native-build/python3 setup.py build_ext -v STDOUT: ********************* * Accelerated build * ********************* running build_ext building 'aiohttp._websocket' extension creating build creating build/temp.macosx-11.7-x86_64-3.9 creating build/temp.macosx-11.7-x86_64-3.9/aiohttp /Users/runner/.android/android-ndk/toolchains/llvm/prebuilt/ darwin-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/Users/runner/.python-for-android/build/other_builds/pytho n3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -I/Users/runner/.android/android-ndk/toolchains/llvm/prebuil t/darwin-x86_64/sysroot/usr/include -I/Users/runner/.python-for-android/build/python-installs/bd ist_unit_tests_app/armeabi-v7a/include/python3.9 -I/Users/runner/.python-for-android/build/other_builds/hostp ython3/desktop/hostpython3/Include -I/Users/runner/.python-for-android/build/other_builds/hostp ython3/desktop/hostpython3/native-build -c aiohttp/_websocket.c -o build/temp.macosx-11.7-x86_64-3.9/aiohttp/_websocket.o clang-14: error: no such file or directory: 'aiohttp/_websocket.c' clang-14: error: no input files error: command '/Users/runner/.android/android-ndk/toolchains/llvm/prebuilt /darwin-x86_64/bin/clang' failed with exit code 1 STDERR: Traceback (most recent call last): File "/Users/runner/work/python-for-android/python-for-android/te stapps/on_device_unit_tests/setup.py", line 106, in setup( File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/setuptools/_distutils/core.p y", line 185, in setup return run_commands(dist) File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/setuptools/_distutils/core.p y", line 201, in run_commands dist.run_commands() File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/setuptools/_distutils/dist.p y", line 973, in run_commands self.run_command(cmd) File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command super().run_command(command) File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/setuptools/_distutils/dist.p y", line 992, in run_command cmd_obj.run() File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/bdistapk.py", line 79, in run main() File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/entrypoints.py", line 18, in main ToolchainCL() File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/toolchain.py", line 730, in __init__ getattr(self, command)(args) File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/toolchain.py", line 153, in wrapper_func build_dist_from_args(ctx, dist, args) File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/toolchain.py", line 212, in build_dist_from_args build_recipes(build_order, python_modules, ctx, File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/build.py", line 505, in build_recipes recipe.build_arch(arch) File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/recipe.py", line 983, in build_arch self.build_compiled_components(arch) File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/recipe.py", line 994, in build_compiled_components shprint(hostpython, 'setup.py', self.build_cmd, '-v', File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/logger.py", line 167, in shprint for line in output: File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 915, in next self.wait() File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 845, in wait self.handle_command_exit_code(exit_code) File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code raise exc sh.ErrorReturnCode_1: RAN: /Users/runner/.python-for-android/build/other_builds/hostpyt hon3/desktop/hostpython3/native-build/python3 setup.py build_ext -v STDOUT: ********************* * Accelerated build * ********************* running build_ext building 'aiohttp._websocket' extension creating build creating build/temp.macosx-11.7-x86_64-3.9 creating build/temp.macosx-11.7-x86_64-3.9/aiohttp /Users/runner/.android/android-ndk/toolchains/llvm/prebuilt/ darwin-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/Users/runner/.python-for-android/build/other_builds/pytho n3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -I/Users/runner/.android/android-ndk/toolchains/llvm/prebuil t/darwin-x86_64/sysroot/usr/include -I/Users/runner/.python-for-android/build/python-installs/bd ist_unit_tests_app/armeabi-v7a/include/python3.9 -I/Users/runner/.python-for-android/build/other_builds/hostp ython3/desktop/hostpython3/Include -I/Users/runner/.python-for-android/build/other_builds/hostp ython3/desktop/hostpython3/native-build -c aiohttp/_websocket.c -o build/temp.macosx-11.7-x86_64-3.9/aiohttp/_websocket.o clang-14: error: no such file or directory: 'aiohttp/_websocket.c' clang-14: error: no input files error: command '/Users/runner/.android/android-ndk/toolchains/llvm/prebuilt /darwin-x86_64/bin/clang' failed with exit code 1">stty: stdin isn't a terminal
[INFO]: -> running python3 setup.py clean --all
stty: stdin isn't a terminal
[INFO]: -> running python3 setup.py build_ext -v
Exception in thread background thread for pid 77842:
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.10/3.10.7/Frameworks/Python.fram ework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/Cellar/python@3.10/3.10.7/Frameworks/Python.fram ework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 1641, in wrap
fn(*rgs, **kwargs)
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 2569, in background_thread
handle_exit_code(exit_code)
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line [2269](https://github.com/kivy/python-for-android/actions/ru ns/3281492031/jobs/5404298939#step:6:2270), in fn
return self.command.handle_command_exit_code(exit_code)
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:

RAN: /Users/runner/.python-for-android/build/other_builds/hostpyt hon3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

STDOUT:
*********************
* Accelerated build *
*********************
running build_ext
building 'aiohttp._websocket' extension
creating build
creating build/temp.macosx-11.7-x86_64-3.9
creating build/temp.macosx-11.7-x86_64-3.9/aiohttp
/Users/runner/.android/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/Users/runner/.python-for-android/build/other_builds/pytho n3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -I/Users/runner/.android/android-ndk/toolchains/llvm/prebuil t/darwin-x86_64/sysroot/usr/include -I/Users/runner/.python-for-android/build/python-installs/bd ist_unit_tests_app/armeabi-v7a/include/python3.9 -I/Users/runner/.python-for-android/build/other_builds/hostp ython3/desktop/hostpython3/Include -I/Users/runner/.python-for-android/build/other_builds/hostp ython3/desktop/hostpython3/native-build -c aiohttp/_websocket.c -o build/temp.macosx-11.7-x86_64-3.9/aiohttp/_websocket.o
clang-14: error: no such file or directory: 'aiohttp/_websocket.c'
clang-14: error: no input files
error: command '/Users/runner/.android/android-ndk/toolchains/llvm/prebuilt /darwin-x86_64/bin/clang' failed with exit code 1


STDERR:

Traceback (most recent call last):
File "/Users/runner/work/python-for-android/python-for-android/te stapps/on_device_unit_tests/setup.py", line 106, in
setup(
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/setuptools/_distutils/core.p y", line 185, in setup
return run_commands(dist)
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/setuptools/_distutils/core.p y", line 201, in run_commands
dist.run_commands()
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/setuptools/_distutils/dist.p y", line 973, in run_commands
self.run_command(cmd)
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/setuptools/_distutils/dist.p y", line 992, in run_command
cmd_obj.run()
File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/bdistapk.py", line 79, in run
main()
File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/toolchain.py", line 730, in __init__
getattr(self, command)(args)
File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/toolchain.py", line 153, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/toolchain.py", line 212, in build_dist_from_args
build_recipes(build_order, python_modules, ctx,
File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/build.py", line 505, in build_recipes
recipe.build_arch(arch)
File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/recipe.py", line 983, in build_arch
self.build_compiled_components(arch)
File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/recipe.py", line 994, in build_compiled_components
shprint(hostpython, 'setup.py', self.build_cmd, '-v',
File "/Users/runner/work/python-for-android/python-for-android/py thonforandroid/logger.py", line 167, in shprint
for line in output:
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 915, in next
self.wait()
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 845, in wait
self.handle_command_exit_code(exit_code)
File "/Users/runner/work/python-for-android/python-for-android/ve nv/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:

RAN: /Users/runner/.python-for-android/build/other_builds/hostpyt hon3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

STDOUT:
*********************
* Accelerated build *
*********************
running build_ext
building 'aiohttp._websocket' extension
creating build
creating build/temp.macosx-11.7-x86_64-3.9
creating build/temp.macosx-11.7-x86_64-3.9/aiohttp
/Users/runner/.android/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/Users/runner/.python-for-android/build/other_builds/pytho n3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -I/Users/runner/.android/android-ndk/toolchains/llvm/prebuil t/darwin-x86_64/sysroot/usr/include -I/Users/runner/.python-for-android/build/python-installs/bd ist_unit_tests_app/armeabi-v7a/include/python3.9 -I/Users/runner/.python-for-android/build/other_builds/hostp ython3/desktop/hostpython3/Include -I/Users/runner/.python-for-android/build/other_builds/hostp ython3/desktop/hostpython3/native-build -c aiohttp/_websocket.c -o build/temp.macosx-11.7-x86_64-3.9/aiohttp/_websocket.o
clang-14: error: no such file or directory: 'aiohttp/_websocket.c'
clang-14: error: no input files
error: command '/Users/runner/.android/android-ndk/toolchains/llvm/prebuilt /darwin-x86_64/bin/clang' failed with exit code 1

See for instance this job: https://github.com/kivy/python-for-android/actions/runs/3281492031/jobs/5404298939
Do you have an idea why?

Copy link
Contributor Author

xavierfiechter commented Oct 19, 2022

That's why I had the tarball from PyPI in the first PR.

aio-libs/aiohttp#3907 (comment)

Can revert to the PyPI URL if you want me to do.

Copy link
Member

AndreMiras commented Oct 19, 2022

Oh right I didn't know that, thanks for the heads up!
Then there's a world in between, try with this pattern instead:

url = "https://pypi.python.org/packages/source/a/aiohttp/aiohttp-{version}.tar.gz"

Copy link
Contributor Author

xavierfiechter commented Oct 19, 2022

Even better.

AndreMiras approved these changes Oct 20, 2022
Copy link
Member

AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The recipe built successfully, thanks again for the pull request and follow up changes

AndreMiras merged commit 7de5d2b into kivy:develop Oct 20, 2022
Copy link
Contributor Author

xavierfiechter commented Oct 20, 2022

@AndreMiras I have two other custom baked recipes that could be streamlined.

One needs a specific commit at the moment.

aiosocks at commit d4a85e73c9e3beadd7ab4c46b8f3ceb3b57338b2

Should I set commit instead of version

e.g. like this?

commit = d4a85e73c9e3beadd7ab4c46b8f3ceb3b57338b2
url = "git+https://github.com/nibrag/aiosocks.git@{commit}"

shyamnathp pushed a commit to shyamnathp/python-for-android that referenced this pull request Feb 17, 2023
* Make CI compile aiohttp again.

References:
https://stackoverflow.com/a/64755338/20124004,
https://stackoverflow.com/a/64755052/20124004,
kivy#2518

* version variable and github url

* lost a newline

* added missing line for pep

* Changed URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

AndreMiras AndreMiras approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants