Skip to content

Commit 81dae84

Browse files
author
Release Manager
committed
sagemathgh-37503: GH Actions: Build macOS arm64 wheels <!-- ^ 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
2 parents 989656a + 1af5b2a commit 81dae84

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/dist.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ jobs:
116116
- os: ubuntu-latest
117117
arch: i686
118118
- os: macos-latest
119-
arch: auto
119+
arch: x86_64
120+
- os: macos-14
121+
arch: arm64
120122
env:
121123
# SPKGs to install as system packages
122124
SPKGS: _bootstrap _prereq
@@ -141,6 +143,14 @@ jobs:
141143
name: dist
142144
path: dist
143145

146+
- uses: actions/setup-python@v5
147+
# As of 2024-02-03, the macOS M1 runners do not have preinstalled python or pipx.
148+
# Installing pipx follows the approach of https://github.com/pypa/cibuildwheel/pull/1743
149+
id: python
150+
with:
151+
python-version: "3.8 - 3.12"
152+
update-environment: false
153+
144154
- name: Build platform wheels
145155
# We build the wheels from the sdists so that MANIFEST filtering becomes effective.
146156
# But we must run cibuildwheel with the unpacked source directory, not a tarball,
@@ -151,12 +161,13 @@ jobs:
151161
# This is unfortunately repeated for each of the packages that we build wheels for
152162
# because CIBW starts with a fresh container on each invocation.
153163
run: |
164+
"${{ steps.python.outputs.python-path }}" -m pip install pipx
154165
export PATH=build/bin:$PATH
155166
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"
156167
mkdir -p unpacked
157168
for pkg in sagemath-objects sagemath-categories; do
158169
(cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz
159-
pipx run cibuildwheel==2.16.2 unpacked/$pkg*
170+
"${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.17.0 unpacked/$pkg*
160171
done
161172
162173
- uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)