Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

build arm wheels on circleci #1743

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
version: 2.1

jobs:
arm-wheels:
parameters:
build:
type: string

machine:
image: ubuntu-2004:2022.04.1
resource_class: arm.medium

environment:
CIBW_BEFORE_ALL_LINUX: "bash tools/install_libzmq.sh"
CIBW_ENVIRONMENT_LINUX: >-
ZMQ_PREFIX=/usr/local
CFLAGS=-Wl,-strip-all
CXXFLAGS=-Wl,-strip-all
CIBW_TEST_REQUIRES: "pytest"
CIBW_TEST_COMMAND: "pytest -vsx {package}/tools/test_wheel.py"
CIBW_ARCHS: "aarch64"
CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux2014_aarch64
CIBW_MUSLLINUX_AARCH64_IMAGE: quay.io/pypa/musllinux_1_1_aarch64
CIBW_BUILD: "<< parameters.build >>"

steps:
- checkout
- run:
name: install cibuildwheel
command: |
python3 -m pip install --upgrade pip setuptools
python3 -m pip install -r tools/wheel-requirements.txt

- run:
name: pip freeze
command: |
python3 -m pip freeze

- run:
name: Cython
# This assumes pytest is installed via the install-package step above
command: |
python3 setup.py fetch_libzmq
python3 setup.py cython

- run:
name: list wheels
command: |
python3 -m cibuildwheel . --print-build-identifiers

- run:
name: cibuildwheel
command: |
python3 -m cibuildwheel .

- store_artifacts:
path: wheelhouse/

- when:
condition:
matches:
pattern: ".+"
value: "<< pipeline.git.tag >>"
steps:
- run:
environment:
TWINE_NONINTERACTIVE: "1"
TWINE_USERNAME: __token__
TWINE_PASSWORD: $TWINE_PASSWORD
command: |
python3 -m pip install twine
twine upload --skip-existing wheelhouse/*

workflows:
wheels: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
jobs:
- arm-wheels:
matrix:
parameters:
build:
- "*manylinux*"
- "*musllinux*"
62 changes: 3 additions & 59 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ on:
- zmq/utils/*.h

env:
cython: "0.29.30"
cibuildwheel: "2.5.0"
TWINE_NONINTERACTIVE: "1"

jobs:
Expand Down Expand Up @@ -48,7 +46,7 @@ jobs:
- name: install dependencies
run: |
pip install --upgrade pip build
pip install cython=="${{ env.cython }}"
pip install -r tools/wheel-requirements.txt

- name: build sdist
run: |
Expand Down Expand Up @@ -99,7 +97,6 @@ jobs:
CIBW_SKIP: "${{ matrix.cibw.skip || '' }}"
CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
CIBW_MANYLINUX_I686_IMAGE: "${{ matrix.cibw.manylinux_image }}"
CIBW_MANYLINUX_AARCH64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
CIBW_ARCHS_LINUX: "${{ matrix.cibw.arch || 'auto' }}"
CIBW_ARCHS_MACOS: "${{ matrix.cibw.arch || 'auto' }}"

Expand Down Expand Up @@ -150,46 +147,6 @@ jobs:
cibw:
skip: "*manylinux*"

- os: ubuntu-20.04
name: cp36-manylinux_aarch64
cibw:
build: "cp36*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: aarch64

- os: ubuntu-20.04
name: cp37-manylinux_aarch64
cibw:
build: "cp37*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: aarch64

- os: ubuntu-20.04
name: cp38-manylinux_aarch64
cibw:
build: "cp38*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: aarch64

- os: ubuntu-20.04
name: cp39-manylinux_aarch64
cibw:
build: "cp39*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: aarch64

- os: ubuntu-20.04
name: cp310-manylinux_aarch64
cibw:
build: "cp310*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: aarch64

- os: windows-2019
name: win32
architecture: x86
Expand Down Expand Up @@ -227,19 +184,6 @@ jobs:
echo 'CIBW_REPAIR_WHEEL_COMMAND_WINDOWS=' >> "$GITHUB_ENV"
echo 'CIBW_ENVIRONMENT_WINDOWS=' >> "$GITHUB_ENV"

- name: register qemu
if: contains(matrix.cibw.arch, 'aarch64')
run: |
docker run --rm --privileged hypriot/qemu-register:v4.2.0

- name: customize aarch64
if: contains(matrix.cibw.arch, 'aarch64')
# install zeromq-devel because building libzmq for arm takes too long
# it's not in default packages, but it is in epel-7
# this will be an older release than than other wheels
run: |
echo 'CIBW_BEFORE_ALL_LINUX=yum -y install epel-release && yum -y install zeromq-devel' >> "$GITHUB_ENV"

- name: customize mac-arm-64
if: contains(matrix.os, 'macos') && matrix.cibw.arch
run: |
Expand All @@ -250,12 +194,12 @@ jobs:
- name: install dependencies
run: |
pip install --upgrade setuptools pip wheel
pip install cibuildwheel=="${{ env.cibuildwheel }}" cython=="${{ env.cython }}"
pip install -r tools/wheel-requirements.txt


- name: install windows dependencies
if: startsWith(matrix.os, 'win')
run: |
pip install delvewheel==0.0.12
python setup.py fetch_libzmq --dll
xcopy /i libzmq-dll C:\\libzmq-dll

Expand Down
3 changes: 3 additions & 0 deletions tools/wheel-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cibuildwheel==2.8.1
cython==0.29.30
delvewheel==0.0.22; sys_platform == 'win32'