Skip to content

Commit 48c1811

Browse files
committed
Use new GitHub native aarch64 macOS runners
Now that GitHub has native arm64 macOS runners we can leverage these to build and test our arm64 macOS wheels directly instead of relying on cross-target compilation, which prevent us from exercising the wheels in the CI. Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
1 parent 41248ed commit 48c1811

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

.github/workflows/build_wheels.yml

+10-11
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,11 @@ jobs:
9393

9494
build_macosx_wheels:
9595
needs: [build_sdist]
96-
name: macosx_${{ matrix.cibw_arch }} wheels
97-
runs-on: macos-11
96+
name: macosx_${{ matrix.os }} wheels
97+
runs-on: ${{ matrix.os }}
9898
strategy:
99-
fail-fast: false
10099
matrix:
101-
cibw_arch: ["x86_64", "arm64"]
102-
100+
os: [macos-11, macos-14]
103101
steps:
104102
- uses: actions/download-artifact@v4
105103
with:
@@ -113,24 +111,25 @@ jobs:
113111
run: |
114112
tar zxvf dist/*.tar.gz --strip-components=1
115113
- name: Sets env vars for compilation
116-
if: matrix.cibw_arch == 'arm64'
114+
if: matrix.os == 'macos-14'
117115
run: |
118-
echo "CFLAGS=-target arm64-apple-macos11" >> $GITHUB_ENV
119-
echo "MEMRAY_LIBBACKTRACE_TARGET=arm64-apple-macos11" >> $GITHUB_ENV
116+
echo "CFLAGS=-target aarch64-apple-darwin" >> $GITHUB_ENV
117+
echo "MEMRAY_LIBBACKTRACE_TARGET=aarch64-apple-darwin" >> $GITHUB_ENV
120118
- name: Build wheels
121119
uses: pypa/cibuildwheel@v2.16.5
122120
env:
123121
CIBW_BUILD: "cp3{8..12}-*"
124-
CIBW_ARCHS_MACOS: ${{ matrix.cibw_arch }}
125122
CIBW_PRERELEASE_PYTHONS: True
126123
CIBW_TEST_EXTRAS: test
127124
CIBW_TEST_COMMAND: pytest {package}/tests
128125
CIBW_BUILD_VERBOSITY: 1
129126
MACOSX_DEPLOYMENT_TARGET: "10.14"
130-
127+
CFLAGS: "${{ env.CFLAGS }} -I/lz4_install/include"
128+
LDFLAGS: "-L/tmp/lz4_install/usr/local/lib -Wl,-rpath,/tmp/lz4_install/usr/local/lib"
129+
DYLD_LIBRARY_PATH: "/tmp/lz4_install/usr/local/lib"
131130
- uses: actions/upload-artifact@v4
132131
with:
133-
name: macosx_${{ matrix.cibw_arch }}-wheels
132+
name: macosx_${{ matrix.os }}-wheels
134133
path: ./wheelhouse/*.whl
135134

136135
build_and_test_wheels:

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ before-all = [
8282
"git clone --depth 1 --branch v1.9.4 https://github.com/lz4/lz4 lz4",
8383
"cd lz4",
8484
"make",
85-
"make install"
85+
"make install DESTDIR=/tmp/lz4_install"
8686
]
8787
before-test = [
8888
"codesign --remove-signature /Library/Frameworks/Python.framework/Versions/*/bin/python3 || true",

0 commit comments

Comments
 (0)