Skip to content

Commit

Permalink
Use new GitHub native aarch64 macOS runners
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pablogsal committed Feb 2, 2024
1 parent 41248ed commit e8a50f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,11 @@ jobs:

build_macosx_wheels:
needs: [build_sdist]
name: macosx_${{ matrix.cibw_arch }} wheels
runs-on: macos-11
name: macosx_${{ matrix.os }} wheels
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
cibw_arch: ["x86_64", "arm64"]

os: [macos-11, macos-14]
steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -113,24 +111,26 @@ jobs:
run: |
tar zxvf dist/*.tar.gz --strip-components=1
- name: Sets env vars for compilation
if: matrix.cibw_arch == 'arm64'
if: matrix.os == 'macos-14'
run: |
echo "CFLAGS=-target arm64-apple-macos11" >> $GITHUB_ENV
echo "MEMRAY_LIBBACKTRACE_TARGET=arm64-apple-macos11" >> $GITHUB_ENV
echo "CFLAGS=-target aarch64-apple-darwin" >> $GITHUB_ENV
echo "MEMRAY_LIBBACKTRACE_TARGET=aarch64-apple-darwin" >> $GITHUB_ENV
echo "LZ4_INSTALL_DIR=/tmp/lz4_install/usr/local/" >> $GITHUB_ENV
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp3{8..12}-*"
CIBW_ARCHS_MACOS: ${{ matrix.cibw_arch }}
CIBW_PRERELEASE_PYTHONS: True
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_BUILD_VERBOSITY: 1
MACOSX_DEPLOYMENT_TARGET: "10.14"

CFLAGS: "${{ env.CFLAGS }} -I/lz4_install/include"
LDFLAGS: "-L${{ env.LZ4_INSTALL_DIR}}/lib -Wl,-rpath,${{env.LZ4_INSTALL_DIR}}/lib"
DYLD_LIBRARY_PATH: "${{ env.LZ4_INSTALL_DIR }}/lib"
- uses: actions/upload-artifact@v4
with:
name: macosx_${{ matrix.cibw_arch }}-wheels
name: macosx_${{ matrix.os }}-wheels
path: ./wheelhouse/*.whl

build_and_test_wheels:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ before-all = [
"git clone --depth 1 --branch v1.9.4 https://github.com/lz4/lz4 lz4",
"cd lz4",
"make",
"make install"
"make install DESTDIR=/tmp/lz4_install"
]
before-test = [
"codesign --remove-signature /Library/Frameworks/Python.framework/Versions/*/bin/python3 || true",
Expand Down

0 comments on commit e8a50f6

Please sign in to comment.