Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump cibuildwheel from 2.17.0 to 2.18.1, increase minimum macOS requirement to Catalina to ensure binary compatibility #206

Merged
merged 17 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,19 @@ jobs:
- uses: actions/checkout@v4
- name: Install cibuildwheel
# Nb. keep cibuildwheel version pin consistent with job below
run: pipx install cibuildwheel==2.17.0
run: pipx install cibuildwheel==2.18.1
- id: set-matrix
run: |
echo "CI_ONLY" $CI_ONLY
if [ "$CI_ONLY" == "true" ]; then
MATRIX="[{'only':'cp312-manylinux_x86_64','os':'ubuntu-20.04'},{'only':'cp312-win_amd64','os':'windows-2019'}, {'only':'cp312-macosx_x86_64','os':'macos-11'}, {'only':'cp312-macosx_arm64','os':'macos-14'}]"
MATRIX="[{'only':'cp312-manylinux_x86_64','os':'ubuntu-20.04'},{'only':'cp312-win_amd64','os':'windows-2019'}, {'only':'cp312-macosx_x86_64','os':'macos-12'}, {'only':'cp312-macosx_arm64','os':'macos-14'}]"
else
MATRIX=$(
{
cibuildwheel --print-build-identifiers --platform linux \
| jq -nRc '{"only": inputs, "os": "ubuntu-20.04"}' \
&& cibuildwheel --print-build-identifiers --platform macos --archs x86_64 \
| jq -nRc '{"only": inputs, "os": "macos-11"}' \
| jq -nRc '{"only": inputs, "os": "macos-12"}' \
&& cibuildwheel --print-build-identifiers --platform macos --archs arm64 \
| jq -nRc '{"only": inputs, "os": "macos-14"}' \
&& cibuildwheel --print-build-identifiers --platform windows \
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
with:
platforms: all
- name: Build and test wheels
uses: pypa/cibuildwheel@v2.17.0
uses: pypa/cibuildwheel@v2.18.1
env:
# FIXME: only run the slow tests when doing regular pushes, or manual - not for PRs
CIBW_TEST_COMMAND: "pytest -v {package}/tests ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && '--runslow' || '' }}"
Expand Down
27 changes: 21 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,39 @@ before-all="yum install -y swig gsl-devel"
# musl uses apk/apt
select = "*musllinux*"
before-all = "apk add swig gsl-dev"
# restore musllinux_1_1 image for the time being (musllinux_1_2 segfaults)
musllinux-x86_64-image="musllinux_1_1"

[tool.cibuildwheel.macos]
# do a per-build 'gsl' installation to force correct architecture when
before-all = "brew install swig"
# re-enable if we need to do a per-build 'gsl' installation to force correct architecture when
# cross-compiling (https://stackoverflow.com/a/75488269)
before-all = "brew install swig gsl"
# before-build = [
# "echo ARCHFLAGS = $ARCHFLAGS", # gets the arch at build-time
# "if [[ $ARCHFLAGS == *arm64 ]]; then brew fetch --force --bottle-tag=arm64_big_sur gsl; brew reinstall $(brew --cache --bottle-tag=arm64_big_sur gsl); else brew reinstall gsl; fi"
# ]
# note that SWIG is already present on runners, no 'brew' installation neeeded
# support cross-compilation on Apple Silicon
# "if [[ $ARCHFLAGS == *arm64 ]]; then BOTTLE_TAG=arm64_big_sur gsl; else BOTTLE_TAG=x86_64_linux; fi",
# "echo BOTTLE_TAG = $BOTTLE_TAG",
#]
archs = ["arm64", "x86_64"] # don't enable "universal2" binary

[[tool.cibuildwheel.overrides]]
select = "*-macosx_*"
inherit.environment="append"
environment = { CPATH="/opt/homebrew/include", LIBRARY_PATH="/opt/homebrew/lib" }

[[tool.cibuildwheel.overrides]]
select = "*-macosx_x86_64"
inherit.environment="append"
environment = { MACOSX_DEPLOYMENT_TARGET="10.15" } # 10.15 is Catalina the minimum version of gsl supported by 'brew'
inherit.before-all="append"
# install the catalina version of `gsl` to match
before-all = "brew fetch --force --bottle-tag=catalina gsl; brew reinstall $(brew --cache --bottle-tag=catalina gsl)"

[[tool.cibuildwheel.overrides]]
select = "*-macosx_arm64"
inherit.before-all="append"
# need to force the Big Sur (MacOS 11.0) version of `gsl` to match the wheel tag, otherwise it will attempt to install MacOS 14 version
before-all = "brew fetch --force --bottle-tag=arm64_big_sur gsl; brew reinstall $(brew --cache --bottle-tag=arm64_big_sur gsl)"

[tool.cibuildwheel.windows]
# use nuget to install gsl on Windows, and manually supply paths
before-all = "nuget install gsl-msvc14-x64 -Version 2.3.0.2779"
Expand Down
Loading