From 06e9ecb2691a397d8e3ef41908c33a338b0cd167 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Fri, 15 Sep 2023 17:52:29 -0400 Subject: [PATCH] Add QEMU setup to dist.yml to create arm64 wheels (#18) * Add QEMU setup to dist.yml * Update pyproject.toml to install Cython via Pip * Update dist.yml to run w/QEMU only on release --- .github/workflows/dist.yml | 9 +++++++-- pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 53d4afd..6632f7e 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -25,6 +25,12 @@ jobs: with: fetch-depth: 0 + - name: Set up QEMU + if: runner.os == 'Linux' and github.event_name == 'release' && github.event.action == 'created' + uses: docker/setup-qemu-action@v2 + with: + platforms: all + - uses: actions/setup-python@v4 name: 'Set up Python 3.11' with: @@ -37,8 +43,7 @@ jobs: - name: 'Build and test wheels' env: CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" - # GH actions is unable to do aarch64 builds at this time - # CIBW_ARCHS_LINUX: auto aarch64 + CIBW_ARCHS_LINUX: auto aarch64 run: | python3 -m cibuildwheel --output-dir dist diff --git a/pyproject.toml b/pyproject.toml index ef75fb5..0f9444d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ environment = {ROCKSDB_VER="v6.14.6", LIBROCKSDB_PATH="/opt/rocksdb-$ROCKSDB_VER [tool.cibuildwheel.linux] # Avoid re-building the C library in every iteration by testing for the build directory. -before-build = "yum install -y bzip2-devel lz4-devel snappy-devel zlib-devel python3-Cython && (test -d $LIBROCKSDB_PATH || ( git clone https://github.com/facebook/rocksdb --depth 1 --branch $ROCKSDB_VER $LIBROCKSDB_PATH && cd $LIBROCKSDB_PATH && CXXFLAGS='-flto -Os -s' PORTABLE=1 make shared_lib -j $(nproc) )) && pushd $LIBROCKSDB_PATH && make install-shared && ldconfig && popd" +before-build = "pip3 install Cython && yum install -y bzip2-devel lz4-devel snappy-devel zlib-devel && (test -d $LIBROCKSDB_PATH || ( git clone https://github.com/facebook/rocksdb --depth 1 --branch $ROCKSDB_VER $LIBROCKSDB_PATH && cd $LIBROCKSDB_PATH && CXXFLAGS='-flto -Os -s' PORTABLE=1 make shared_lib -j $(nproc) )) && pushd $LIBROCKSDB_PATH && make install-shared && ldconfig && popd" [tool.cibuildwheel.macos] environment = {ROCKSDB_VER="v6.29.5", LIBROCKSDB_PATH="/usr/local/opt/rocksdb-$ROCKSDB_VER", LIBRARY_PATH="/usr/local/lib/"}