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

Make CI compile aiohttp again. #2690

Merged
merged 5 commits into from
Oct 20, 2022
Merged

Conversation

xavierfiechter
Copy link
Contributor

Copy link
Member

@AndreMiras 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

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"

AndreMiras
AndreMiras previously approved these changes Oct 19, 2022
Copy link
Member

@AndreMiras 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

Comment on lines +17 to 18
return env

Copy link
Member

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

@AndreMiras
Copy link
Member

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

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/[email protected]/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/[email protected]/3.10.7/Frameworks/Python.framework/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/venv/lib/python3.10/site-packages/sh.py", line 1641, in wrap
    fn(*rgs, **kwargs)
  File "/Users/runner/work/python-for-android/python-for-android/venv/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/venv/lib/python3.10/site-packages/sh.py", line [2269](https://github.com/kivy/python-for-android/actions/runs/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/venv/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/hostpython3/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/python3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -I/Users/runner/.android/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include -I/Users/runner/.python-for-android/build/python-installs/bdist_unit_tests_app/armeabi-v7a/include/python3.9 -I/Users/runner/.python-for-android/build/other_builds/hostpython3/desktop/hostpython3/Include -I/Users/runner/.python-for-android/build/other_builds/hostpython3/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/testapps/on_device_unit_tests/setup.py", line 106, in <module>
    setup(
  File "/Users/runner/work/python-for-android/python-for-android/venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/Users/runner/work/python-for-android/python-for-android/venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/Users/runner/work/python-for-android/python-for-android/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_commands
    self.run_command(cmd)
  File "/Users/runner/work/python-for-android/python-for-android/venv/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/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 992, in run_command
    cmd_obj.run()
  File "/Users/runner/work/python-for-android/python-for-android/pythonforandroid/bdistapk.py", line 79, in run
    main()
  File "/Users/runner/work/python-for-android/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/Users/runner/work/python-for-android/python-for-android/pythonforandroid/toolchain.py", line 730, in __init__
    getattr(self, command)(args)
  File "/Users/runner/work/python-for-android/python-for-android/pythonforandroid/toolchain.py", line 153, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/Users/runner/work/python-for-android/python-for-android/pythonforandroid/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/pythonforandroid/build.py", line 505, in build_recipes
    recipe.build_arch(arch)
  File "/Users/runner/work/python-for-android/python-for-android/pythonforandroid/recipe.py", line 983, in build_arch
    self.build_compiled_components(arch)
  File "/Users/runner/work/python-for-android/python-for-android/pythonforandroid/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/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/Users/runner/work/python-for-android/python-for-android/venv/lib/python3.10/site-packages/sh.py", line 915, in next
    self.wait()
  File "/Users/runner/work/python-for-android/python-for-android/venv/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/venv/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/hostpython3/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/python3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -I/Users/runner/.android/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include -I/Users/runner/.python-for-android/build/python-installs/bdist_unit_tests_app/armeabi-v7a/include/python3.9 -I/Users/runner/.python-for-android/build/other_builds/hostpython3/desktop/hostpython3/Include -I/Users/runner/.python-for-android/build/other_builds/hostpython3/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?

@xavierfiechter
Copy link
Contributor Author

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.

@AndreMiras
Copy link
Member

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"

@xavierfiechter
Copy link
Contributor Author

Even better.

Copy link
Member

@AndreMiras 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 AndreMiras merged commit 7de5d2b into kivy:develop Oct 20, 2022
@xavierfiechter
Copy link
Contributor Author

@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants