Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Add QEMU setup to dist.yml to create arm64 wheels (#18)
Browse files Browse the repository at this point in the history
* Add QEMU setup to dist.yml

* Update pyproject.toml to install Cython via Pip

* Update dist.yml to run w/QEMU only on release
  • Loading branch information
wbarnha authored Sep 15, 2023
1 parent 9b81bed commit 06e9ecb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"}
Expand Down

0 comments on commit 06e9ecb

Please sign in to comment.