You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by jm...@apache.org on 2023/01/21 22:50:19 UTC
[datasketches-cpp] 01/01: Build linux arm64/aarch64 wheel via emulation, simplify config with env variables
This is an automated email from the ASF dual-hosted git repository.
jmalkin pushed a commit to branch linux-arm64-wheels
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git
commit 53540fa5b82d3dbd70186512dda92948f611fe5a
Author: Jon Malkin <78...@users.noreply.github.com>
AuthorDate: Sat Jan 21 14:49:19 2023 -0800
Build linux arm64/aarch64 wheel via emulation, simplify config with env variables
---
.github/workflows/build_wheels.yml | 45 ++++++++++++++++++++++----------------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml
index 380777e..28d12a0 100644
--- a/.github/workflows/build_wheels.yml
+++ b/.github/workflows/build_wheels.yml
@@ -3,10 +3,11 @@ name: Build Python Wheels
on:
# allow manual runs
workflow_dispatch:
+
# run when we tag a release
- release:
- types:
- - "created"
+ #release:
+ # types:
+ # - "created"
env:
BUILD_TYPE: Release
@@ -29,7 +30,7 @@ jobs:
- name: Build sdist
run: python -m build --sdist --outdir dist
- - uses: actions/upload-artifact@v2
+ - uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
@@ -37,7 +38,6 @@ jobs:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
- #fail-fast: false
matrix:
config:
- {
@@ -55,6 +55,12 @@ jobs:
os: ubuntu-latest,
cibw-arch: manylinux_x86_64
}
+ - {
+ name: "Ubuntu Latest (ARM64)",
+ os: ubuntu-latest,
+ cibw-arch: manylinux_aarch64,
+ use-qemu: true
+ }
- {
name: "Ubuntu Latest (i686)",
os: ubuntu-latest,
@@ -66,7 +72,6 @@ jobs:
cibw-arch: win_amd64
}
-
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -75,25 +80,27 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.x'
-
+
+ - name: Set up QEMU for linux/arm64 builds
+ if: runner.os == 'Linux' && matrix.config.use-qemu == true
+ uses: docker/setup-qemu-action@v2
+ with:
+ platforms: arm64
+
- name: Install Python dependencies
- run: python -m pip install cibuildwheel==2.5.0
-
- - name: Configure cibuildwheel
- shell: bash
- run: |
- CMAKE_OSX_ARCHITECTURES=${{ matrix.config.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.config.cibw-arch == 'macosx_arm64' && 'arm64' || matrix.config.cibw-arch == 'macosx_universal2' && '"arm64;x86_64"' || '' }}
- echo "CIBW_ARCHS_MACOS=x86_64 arm64" >> $GITHUB_ENV
- echo "CIBW_BUILD=*-${{ matrix.config.cibw-arch }}" >> $GITHUB_ENV
- echo "CIBW_ENVIRONMENT_MACOS=CMAKE_OSX_ARCHITECTURES=\"$CMAKE_OSX_ARCHITECTURES\"" >> $GITHUB_ENV
-
+ run: python -m pip install cibuildwheel==2.12.0
+
- name: Build wheels
run: python -m cibuildwheel --output-dir dist
env:
+ CIBW_ARCHS_LINUX: "auto aarch64"
+ CIBW_ARCHS_MACOS: "x86_64 arm64"
+ CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES=${{ matrix.config.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.config.cibw-arch == 'macosx_arm64' && 'arm64' || '' }}
+ CIBW_BUILD: "*-${{ matrix.config.cibw-arch }}"
CIBW_BEFORE_BUILD_LINUX: "yum remove -y cmake"
CIBW_BEFORE_BUILD: "python -m pip install cmake>=3.18"
- CIBW_SKIP: "*-win32 pp*-macosx*"
+ CIBW_SKIP: "*-win32 pp*-aarch64 pp*-macosx"
- - uses: actions/upload-artifact@v2
+ - uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org