From bcd06742b79de4a4415801219f07728e3425baed Mon Sep 17 00:00:00 2001 From: Aaron Miller Date: Tue, 23 Apr 2024 20:39:29 -0700 Subject: [PATCH 1/2] Fix cibuildwheel install --- .github/scripts/mac_install_gmp.sh | 17 ----------------- .github/workflows/build_wheels.yml | 30 ++++++++++++------------------ 2 files changed, 12 insertions(+), 35 deletions(-) delete mode 100755 .github/scripts/mac_install_gmp.sh diff --git a/.github/scripts/mac_install_gmp.sh b/.github/scripts/mac_install_gmp.sh deleted file mode 100755 index 2bccab060..000000000 --- a/.github/scripts/mac_install_gmp.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# ---------------------------------------------------------------------------- -# SymForce - Copyright 2022, Skydio, Inc. -# This source code is under the Apache 2.0 license found in the LICENSE file. -# ---------------------------------------------------------------------------- - -set -ex - -if [ "$CIBW_ARCHS_MACOS" = "arm64" ]; then - mkdir arm-homebrew - curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C arm-homebrew - cache_path=$(./arm-homebrew/bin/brew --cache gmp) - echo "Using cache_path: ${cache_path}" - curl --output ${cache_path} https://symforce.org/downloads/gmp-6.2.1_1.arm64_big_sur.bottle.tar.gz - ./arm-homebrew/bin/brew install ${cache_path} -fi diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 2258dade3..f909f6a60 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -30,52 +30,46 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest] + # 13 is x86_64, latest (14+) is arm64 + os: [macos-13, macos-latest] python-version: [cp38, cp39, cp310, cp311, cp312] - arch: [x86_64, arm64] steps: - name: Checkout uses: actions/checkout@v4 - - name: Install cibuildwheel - run: python3 -m pip install cibuildwheel==2.16.5 - - name: Build wheels - run: python3 -m cibuildwheel --output-dir wheelhouse + uses: pypa/cibuildwheel@v2.17.0 env: CIBW_BUILD: ${{ matrix.python-version }}-* - CIBW_ARCHS_MACOS: ${{ matrix.arch }} CIBW_BUILD_FRONTEND: build - GMP_ROOT: /Users/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/arm-homebrew/opt/gmp - CIBW_BEFORE_BUILD: ./.github/scripts/mac_install_gmp.sh + # For arm64; for x86, it's at /usr/local but cmake finds that ok already + GMP_ROOT: /opt/homebrew + CIBW_BEFORE_BUILD: brew install gmp CIBW_ENVIRONMENT: SYMFORCE_REWRITE_LOCAL_DEPENDENCIES=True - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: symforce-wheels-macos-${{ matrix.python-version }}-${{ matrix.arch }} + name: symforce-wheels-${{ matrix.os }}-${{ matrix.python-version }} path: wheelhouse/*.whl build-linux: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: + os: [ubuntu-latest] python-version: [cp38, cp39, cp310, cp311, cp312] - arch: [x86_64] steps: - name: Checkout uses: actions/checkout@v4 - - name: Install cibuildwheel - run: python3 -m pip install cibuildwheel==2.16.5 - - name: Build wheels - run: python3 -m cibuildwheel --output-dir wheelhouse + uses: pypa/cibuildwheel@v2.17.0 env: - CIBW_BUILD: ${{ matrix.python-version }}-manylinux_${{ matrix.arch }} + CIBW_BUILD: ${{ matrix.python-version }}-manylinux_x86_64 CIBW_BUILD_FRONTEND: build CIBW_BEFORE_BUILD: yum install -y gmp-devel git CIBW_ENVIRONMENT: SYMFORCE_REWRITE_LOCAL_DEPENDENCIES=True @@ -83,7 +77,7 @@ jobs: - name: Upload Wheels uses: actions/upload-artifact@v4 with: - name: symforce-wheels-linux-${{ matrix.python-version }} + name: symforce-wheels-${{ matrix.os }}-${{ matrix.python-version }} path: wheelhouse/*.whl merge-wheel-artifacts: From f060d2dd5f0efcf22ab221bda3e0ef7bef842a69 Mon Sep 17 00:00:00 2001 From: Aaron Miller <78561124+aaron-skydio@users.noreply.github.com> Date: Wed, 24 Apr 2024 17:38:57 -0700 Subject: [PATCH 2/2] Update build_wheels.yml --- .github/workflows/build_wheels.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index f909f6a60..7dfe54e6b 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -26,12 +26,15 @@ jobs: path: dist/* build-macos: - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os.runner }} strategy: fail-fast: false matrix: - # 13 is x86_64, latest (14+) is arm64 - os: [macos-13, macos-latest] + os: + - runner: macos-13 + arch: x86_64 + - runner: macos-latest + arch: arm64 python-version: [cp38, cp39, cp310, cp311, cp312] steps: @@ -42,6 +45,7 @@ jobs: uses: pypa/cibuildwheel@v2.17.0 env: CIBW_BUILD: ${{ matrix.python-version }}-* + CIBW_ARCHS_MACOS: ${{ matrix.os.arch }} CIBW_BUILD_FRONTEND: build # For arm64; for x86, it's at /usr/local but cmake finds that ok already GMP_ROOT: /opt/homebrew @@ -51,7 +55,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: symforce-wheels-${{ matrix.os }}-${{ matrix.python-version }} + name: symforce-wheels-${{ matrix.os.arch }}-${{ matrix.python-version }} path: wheelhouse/*.whl build-linux: