Skip to content

Commit

Permalink
sagemathgh-37503: GH Actions: Build macOS arm64 wheels
Browse files Browse the repository at this point in the history
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Using https://cibuildwheel.readthedocs.io/en/stable/changelog/#v2165

Example run: https://github.com/mkoeppe/sage/actions/runs/8088717795/job
/22103468674#step:5:11246

Part of:
- sagemath#31251

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37503
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee
  • Loading branch information
Release Manager committed Apr 20, 2024
2 parents 989656a + 1af5b2a commit 81dae84
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ jobs:
- os: ubuntu-latest
arch: i686
- os: macos-latest
arch: auto
arch: x86_64
- os: macos-14
arch: arm64
env:
# SPKGs to install as system packages
SPKGS: _bootstrap _prereq
Expand All @@ -141,6 +143,14 @@ jobs:
name: dist
path: dist

- uses: actions/setup-python@v5
# As of 2024-02-03, the macOS M1 runners do not have preinstalled python or pipx.
# Installing pipx follows the approach of https://github.com/pypa/cibuildwheel/pull/1743
id: python
with:
python-version: "3.8 - 3.12"
update-environment: false

- name: Build platform wheels
# We build the wheels from the sdists so that MANIFEST filtering becomes effective.
# But we must run cibuildwheel with the unpacked source directory, not a tarball,
Expand All @@ -151,12 +161,13 @@ jobs:
# This is unfortunately repeated for each of the packages that we build wheels for
# because CIBW starts with a fresh container on each invocation.
run: |
"${{ steps.python.outputs.python-path }}" -m pip install pipx
export PATH=build/bin:$PATH
export CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || echo error ignored) ) && ./bootstrap && ./configure --enable-build-as-root && make -j4 V=0 $TARGETS_PRE"
mkdir -p unpacked
for pkg in sagemath-objects sagemath-categories; do
(cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz
pipx run cibuildwheel==2.16.2 unpacked/$pkg*
"${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.17.0 unpacked/$pkg*
done
- uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 81dae84

Please sign in to comment.