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

Cross compilation for actually unsupported platform #1409

Open
gpongelli opened this issue Jan 30, 2023 · 3 comments
Open

Cross compilation for actually unsupported platform #1409

gpongelli opened this issue Jan 30, 2023 · 3 comments

Comments

@gpongelli
Copy link

Description

Hi,
thanks for this awesome tool!

I'm starting using it on github actions to build python packages, and I'm facing issue because ARMv7 architecture is no more supported, no MANYLINUX images exist anymore (I've found some past issue on this task).

My github action obviously do setup QEMU before running cibuildwheel with following action

      - name: Set up QEMU
        if: runner.os == 'Linux'
        uses: docker/setup-qemu-action@v2
        with:
          platforms: all

and QEMU prints that it can cross-compile to ARMv7 architecture:

Extracting available platforms
  linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6

For those architecture no more supported in cibuildwheel, but present in qemu, I've imagined a way to handle them, but I don't know if it's possible to implement it, so let's here to discuss 😉 :

  1. specify under CIBW_ARCHS the arch to be built, even if it's missing from arch's table (e.g. CIBW_ARCHS_LINUX: auto armv7 )
  2. "auto" arch behave as usual, but there's no image for armv7 arch -> search for a CIBW_MANYLINUX_*_IMAGE, CIBW_MUSLLINUX_*_IMAGE that matches the required architecture -> CIBW_MANYLINUX_ARMV7_IMAGE CIBW_MUSLLINUX_ARMV7_IMAGE
  3. if a MANYLINUX/MUSLLINUX image is defined (e.g. CIBW_MANYLINUX_ARMV7_IMAGE: dockcross/manylinux-armv7 ), use it

Obviously, the image to be use has to respect the constraint as specified in CIBW_MANYLINUX_*_IMAGE, CIBW_MUSLLINUX_*_IMAGE paragraph:

If setting a custom image, you'll need to make sure it can be used in the same way as the default images: 
all necessary Python and pip versions need to be present in /opt/python/, and the auditwheel tool 
needs to be present for cibuildwheel to work.

So, what do you think about this enhancement ?

Build log

No response

CI config

No response

@joerick
Copy link
Contributor

joerick commented Apr 1, 2023

Hey! This would be a fairly significant refactor, as currently we hard-code the build identifiers in the build-platforms.toml file. These are recorded with other information like where to find the relevant python in the build image, or URLs for download, and are (for mac/windows) automatically kept up-to-date by other tooling.

So it's kinda awkward to do this. If we were to make such a change, I'd want to be sure that it's worth the time and ongoing complexity. If there's a specific platform that's of interest (it looks like arm7 is cropping up a bit recently), perhaps we could add 'experimental' support for this arch without including it in auto or all, and without specifying a default image.

However, probably an easier approach for you would be to fork cibuildwheel and add the few lines around the codebase to get a version that supports the arch you're looking for.

@wbarnha
Copy link
Contributor

wbarnha commented Jun 27, 2023

Just wanted to bump this issue and mention support for ARMv7 would be greatly appreciated!

@henryiii
Copy link
Contributor

If this goes in: pypa/manylinux#1455 then we can add a musl ARMv7.

Actually, would it be possible to add a spot for manylinux ARMv7 but no pre-defined images? It would rather make sense since it's an allowed wheel platform, just there have never been any official images for ARMv7 due to CentOS/Alma not supporting it.

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

No branches or pull requests

4 participants