Skip to content

Commit 53d879a

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 53d879a

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

.github/workflows/build_wheels.yml

+11-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,26 @@ 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
118+
echo "LZ4_INSTALL_DIR=/tmp/lz4_install/usr/local/" >> $GITHUB_ENV
120119
- name: Build wheels
121120
uses: pypa/cibuildwheel@v2.16.5
122121
env:
123122
CIBW_BUILD: "cp3{8..12}-*"
124-
CIBW_ARCHS_MACOS: ${{ matrix.cibw_arch }}
125123
CIBW_PRERELEASE_PYTHONS: True
126124
CIBW_TEST_EXTRAS: test
127125
CIBW_TEST_COMMAND: pytest {package}/tests
128126
CIBW_BUILD_VERBOSITY: 1
129127
MACOSX_DEPLOYMENT_TARGET: "10.14"
130-
128+
CFLAGS: "${{ env.CFLAGS }} -I/lz4_install/include"
129+
LDFLAGS: "-L${{ env.LZ4_INSTALL_DIR}}/lib -Wl,-rpath,${{env.LZ4_INSTALL_DIR}}/lib"
130+
DYLD_LIBRARY_PATH: "${{ env.LZ4_INSTALL_DIR }}/lib"
131131
- uses: actions/upload-artifact@v4
132132
with:
133-
name: macosx_${{ matrix.cibw_arch }}-wheels
133+
name: macosx_${{ matrix.os }}-wheels
134134
path: ./wheelhouse/*.whl
135135

136136
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)