I am trying to build python wheels for a package (lap) for the aarch64
architecture. My host environment is WSL2 with Ubuntu 20.04 and docker
. Target is Buildroot GNU/Linux
. So no compiler is available on the target. My goal is to setup a cross-build environment for aarch64
using qemu
. As described in Run a AArch64 native container on x86 with emulation we can use a containerized environment available to run on AArch64 to build wheels to the current specification with QEMU emulator. Steps I am doing:
- installing qemu packages in WSL2
sudo apt-get install qemu binfmt-support qemu-user-static
- registering scripts:
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- Testing the emulation environment
docker run --rm -t arm64v8/ubuntu uname -m
and it returnsaarch64
so, I believe the installation was successful, the emulation is working. Also,qemu-aarch64-static
is available in/usr/bin/
- Now I clone the project lap (in
WSL2
) andcd lap/
and it containssetup.py
but when I execute below command to build the wheelsdocker run --rm -v `pwd`:/io quay.io/pypa/manylinux2014_aarch64 bash -c '/opt/python/cp38-cp38/bin/python ./setup.py bdist_wheel'
I get below error
```
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested
/opt/python/cp38-cp38/bin/python: can't open file './setup.py': [Errno 2] No such file or directory
```
Now I am not sure how to pass qemu-aarch64-static
to above docker
command?
Can any one please let me know how to resolve this and build python wheels using QEMU?
Thanks in advance.
P.S: Please let me know if any info is missing.