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

Commit 9b81bed

Browse files
Revisit macos (#2) (#16)
* Revisit macos (#2) chore: add macos arm build --------- Co-authored-by: William Barnhart <[email protected]> * Update pyproject.toml to build for cp3* instead of cp38* * Update dist.yml --------- Co-authored-by: William Barnhart <[email protected]> Co-authored-by: William Barnhart <[email protected]>
1 parent f1ca9cb commit 9b81bed

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

.github/workflows/dist.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@ name: 'Build and test wheels for release'
44
on:
55
release:
66
types: [created]
7+
pull_request:
8+
push:
79
branches:
810
- 'master'
11+
- 'force_ci/all/**' # For development, forcing all workflows to run.
12+
- 'force_ci/debian/**' # For debugging and/or only forcing this workflow.
913

1014
jobs:
1115
build_wheels:
1216
name: 'Build and test wheels'
1317
runs-on: ${{ matrix.os }}
1418
strategy:
1519
matrix:
16-
os: [ubuntu-latest]
20+
os: [ubuntu-latest, macos-11]
1721

1822
steps:
1923
- uses: actions/checkout@v3
@@ -31,6 +35,10 @@ jobs:
3135
python3 -m pip install cibuildwheel
3236
3337
- name: 'Build and test wheels'
38+
env:
39+
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
40+
# GH actions is unable to do aarch64 builds at this time
41+
# CIBW_ARCHS_LINUX: auto aarch64
3442
run: |
3543
python3 -m cibuildwheel --output-dir dist
3644

pyproject.toml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[tool.cibuildwheel]
66
build-frontend = "build"
77
build = "cp3*"
8-
skip = ["*-win32", "*-manylinux_i686", "*-musllinux_*"]
8+
skip = ["*-macosx_universal*", "*-win32", "*-manylinux_i686", "*-musllinux_*"]
99
archs = ["auto64"]
1010
test-requires = ['.[test] pytest']
1111
test-command = ['pytest --pyargs rocksdb']
@@ -16,22 +16,19 @@ environment = {ROCKSDB_VER="v6.14.6", LIBROCKSDB_PATH="/opt/rocksdb-$ROCKSDB_VER
1616

1717
[tool.cibuildwheel.linux]
1818
# Avoid re-building the C library in every iteration by testing for the build directory.
19-
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 4 )) && pushd $LIBROCKSDB_PATH && make install-shared && ldconfig && popd"
19+
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"
2020

2121
[tool.cibuildwheel.macos]
22-
environment = {ROCKSDB_VER="v6.14.6", LIBROCKSDB_PATH="/usr/local/opt/rocksdb-$ROCKSDB_VER", REPAIR_LIBRARY_PATH="$LIBROCKS_DB_PATH"}
22+
environment = {ROCKSDB_VER="v6.29.5", LIBROCKSDB_PATH="/usr/local/opt/rocksdb-$ROCKSDB_VER", LIBRARY_PATH="/usr/local/lib/"}
2323
before-build = [
2424
"brew install bzip2 lz4 snappy zlib cython git",
2525
'export LDFLAGS="-L/usr/local/opt/bzip2/lib"',
2626
'export CPPFLAGS="-I/usr/local/opt/bzip2/include"',
27-
"(test -d $LIBROCKSDB_PATH || ( git clone https://github.com/facebook/rocksdb --depth 1 --branch $ROCKSDB_VER $LIBROCKSDB_PATH && cd $LIBROCKSDB_PATH && CXXFLAGS='-flto -Os' PORTABLE=1 make shared_lib -j 4 )) && pushd $LIBROCKSDB_PATH && make install-shared && update_dyld_shared_cache && popd",
28-
"otool -L librocksdb.6.14.dylib",
27+
'alias nproc="sysctl -n hw.logicalcpu"',
28+
"(test -d $LIBROCKSDB_PATH || ( git clone https://github.com/facebook/rocksdb --depth 1 --branch $ROCKSDB_VER $LIBROCKSDB_PATH && cd $LIBROCKSDB_PATH && CXXFLAGS='-flto -Os' PORTABLE=1 make shared_lib -j $(nproc) )) && pushd $LIBROCKSDB_PATH && make install-shared && update_dyld_shared_cache && popd",
2929
]
30-
repair-wheel-command = """\
31-
DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps {wheel} &&
32-
DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel \
33-
--require-archs {delocate_archs} -w {dest_dir} -v {wheel}\
34-
"""
30+
repair-wheel-command='DYLD_LIBRARY_PATH=$LIBROCKSDB_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}'
31+
test-command = ['DYLD_LIBRARY_PATH=$LIBROCKSDB_PATH pytest --pyargs rocksdb']
3532

3633
[tool.cibuildwheel.windows]
3734
before-build = [

0 commit comments

Comments
 (0)