Closed magicse closed 1 year ago
What's the method of installation? Were aiohttp and it's deps installed from the musllinux wheels on PyPI or compiled from sdist?
Also, is this reproducible with aiohttp v3.8.4?
I try different methods Last metod
wget https://files.pythonhosted.org/packages/5a/86/5f63de7a202550269a617a5d57859a2961f3396ecd1739a70b92224766bc/aiohttp-3.8.1.tar.gz
tar -xf aiohttp-3.8.1.tar.gz
cd aiohttp-3.8.1.tar.gz
find ./* -mtime +10950 -exec touch {} +
python setup.py build -j 4 install
Using setup.py
as a CLI script is not supported. Use pip or pypa/build.
bash-5.1# cd aiohttp-3.8.1
bash-5.1# pip install -e .
Obtaining file:///home/aiohttp-3.8.1
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Installing backend dependencies ... done
Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/site-packages (from aiohttp==3.8.1) (1.8.1)
Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /usr/local/lib/python3.10/site-packages (from aiohttp==3.8.1) (2.1.1)
Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/site-packages (from aiohttp==3.8.1) (1.3.1)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/site-packages (from aiohttp==3.8.1) (4.0.2)
Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/site-packages (from aiohttp==3.8.1) (22.2.0)
Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/site-packages (from aiohttp==3.8.1) (6.0.4)
Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/site-packages (from aiohttp==3.8.1) (1.3.3)
Requirement already satisfied: idna>=2.0 in /usr/local/lib/python3.10/site-packages (from yarl<2.0,>=1.0->aiohttp==3.8.1) (3.4)
Building wheels for collected packages: aiohttp
Building editable for aiohttp (pyproject.toml) ... done
Created wheel for aiohttp: filename=aiohttp-3.8.1-0.editable-cp310-cp310-linux_armv7l.whl size=5395 sha256=1445b7e2b9fad1209a82d353a0bd51ebc625931585d2cb4f90462b3907794da7
Stored in directory: /tmp/pip-ephem-wheel-cache-svoy2sy0/wheels/fe/10/79/4b0cb50d2a47f838863e8114f00e29bc379736ab400ca74f1b
Successfully built aiohttp
Installing collected packages: aiohttp
Attempting uninstall: aiohttp
Found existing installation: aiohttp 3.8.1
Uninstalling aiohttp-3.8.1:
Successfully uninstalled aiohttp-3.8.1
Successfully installed aiohttp-3.8.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
bash-5.1# python
Python 3.10.7 (main, Nov 24 2022, 13:02:43) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aiohttp
Segmentation fault
bash-5.1#
You don't really need it to be editable or unpack it manually. In fact, there's no testing for building the unpacked sdists. Try installing from PyPI. Also, choose the latest version.
linux_armv7l
I missed that it's also an old ARM arch. I'm guessing it's some like Raspberry? This explains why there's no wheel for your env — the newer envs are better standardized and we ship musllinux wheels for aarch64.
Also, this means that aiohttp was never tested on that platform and having no access to the hardware, it's rather hard to guess what's needed for your case to work.
One thing to change is to try running a reproducer on a clean Python alpine image. We're definitely not going to debug third party software that might've influenced your custom image.
Oh, and as an immediate workaround, you can set AIOHTTP_NO_EXTENSIONS=1
env var to force it to use pure-Python env fallbacks. The segfaulting bit is C-extensions. If you do not use them, they won't fail. It'll be slower, though.
I missed that it's also an old ARM arch. I'm guessing it's some like Raspberry?
This is QNAP TS-231P3 with Home assistant docker image.
@a8e86c47f7cb:/home/aiohttp-3.8.1$ uname -a
Linux a8e86c47f7cb 4.2.8 #2 SMP Thu Jan 12 10:44:50 CST 2023 armv7l Linux
@a8e86c47f7cb:/home/aiohttp-3.8.1$ uname -m
armv7l
bash-5.1# cat /proc/cpuinfo
processor : 0
model name : Annapurna Labs Alpine AL314 Quad-core ARM Cortex-A15 CPU @ 1.70GHz
Speed : 1.7GHz
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc0f
CPU revision : 4
And after some update home assistant didn't work. That is why I dig for this problem.
FWIW try out all the things I pointed out earlier. Also, this issue needs a reproducer that doesn't depend on how someone else (as in HA) built their images. It'd expect a proper repro to use some raw official Python Alpine image demonstrating that this problem exists in isolated. Until then, for what we know, it could be HA breaking musl or smth in the image.
On the original clear Alpine 3.16 docker image, aiohttp is compiled and works just fine. Home Assistant too )) Hah. Yes you are right they broke smth in wheels or image.
I can't think of a way wheels could break musl but I trust that the HA devs can figure it out. It sounds like this issue doesn't need to remain open, now that it's clear that the bug is not coming from us. So I'm going to close it.
Describe the bug
Arm docker Alpine 3.16 Python 3.10.7
To Reproduce
python3 -c "import aiohttp"
Expected behavior
simple import aiohttp in python
Logs/tracebacks
Python Version
aiohttp Version
multidict Version
yarl Version
OS
Alpine 3.16 Docker
Related component
Client
Additional context
homeassistant docker image
Code of Conduct