Skip to content

try ios wheels #2114

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

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ env:

jobs:
test:
if: "false"
runs-on: ${{ matrix.os }}
timeout-minutes: 20
continue-on-error: ${{ matrix.zmq == 'head' || matrix.python == '3.14' }}
Expand Down
75 changes: 6 additions & 69 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,78 +73,15 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
name: mac-pypy
- os: macos-15
name: ios
cibw:
build: "pp*"
platform: "ios"

- os: macos-14
name: mac-cpython
cibw:
arch: universal2
build: "cp*"

- name: manylinux-x86_64
cibw:
arch: x86_64
build: "*manylinux*"

- name: manylinux-i686
cibw:
arch: i686
build: "*manylinux*"

- name: manylinux-arm
os: ubuntu-24.04-arm
cibw:
build: "*manylinux*"

# additional manylinux variants, not specified in pyproject.toml:
# this is where we would add e.g. older manylinux_2014 builds
# - name: manylinux-x86_64-2014
# - os: macos-13
# name: mac-pypy
# cibw:
# arch: x86_64
# build: "cp31*-manylinux* pp39-manylinux*"
# manylinux_x86_64_image: manylinux_2_28

- name: musllinux
cibw:
arch: auto,auto32
build: "*musllinux*"

- name: musllinux-arm
os: ubuntu-24.04-arm
cibw:
build: "*musllinux*"

- name: android
os: ubuntu-24.04
cibw:
platform: android
arch: all

- name: win32
os: windows-2022
architecture: x86
cibw:
build: "cp*win32"

- os: windows-2022
name: win-pypy
architecture: x64
cibw:
build: "pp*win_amd64"

- os: windows-2022
name: win_amd64
architecture: x64
cibw:
build: "cp*win_amd64"

- os: windows-11-arm
name: win_arm64
cibw:
arch: ARM64
# build: "pp*"

steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ if (ZMQ_PREFIX STREQUAL "bundled")
)

# add --host for cross compiling
message(STATUS "Cross: ${CMAKE_CROSSCOMPILING} $ENV{CIBW_HOST_TRIPLET}")
message(STATUS "Checking cross compilation config: cross=${CMAKE_CROSSCOMPILING} host=$ENV{CIBW_HOST_TRIPLET}")
if(IOS AND NOT ENV{CIBW_HOST_TRIPLET})
message(STATUS "Guessing host triplet arm64-apple-ios for cross compilation")
set(ENV{CIBW_HOST_TRIPLET} "arm64-apple-ios")
endif()
if(CMAKE_CROSSCOMPILING AND DEFINED ENV{CIBW_HOST_TRIPLET})
message(STATUS "Cross compiling libsodium for host: $ENV{CIBW_HOST_TRIPLET}")
list(APPEND libsodium_configure "--host=$ENV{CIBW_HOST_TRIPLET}")
Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ repair-wheel-command = "delocate-wheel --sanitize-rpaths --require-archs {deloca
ZMQ_PREFIX = "/tmp/zmq"
MACOSX_DEPLOYMENT_TARGET = "10.15"

[tool.cibuildwheel.ios]
# need cmake >=4 for https://github.com/pypa/cibuildwheel/issues/2435
before-all = "brew upgrade cmake"
xbuild-tools = ["cmake", "ninja"]

[tool.cibuildwheel.ios.config-settings]
"cmake.define.ZMQ_PREFIX" = "bundled"
"cmake.define.CMAKE_SYSTEM_NAME" = "iOS"
"cmake.define.CMAKE_SYSTEM_VERSION" = "13"

[tool.cibuildwheel.windows]
before-all = "python buildutils/bundle.py licenses"
repair-wheel-command = """\
Expand Down
14 changes: 12 additions & 2 deletions tools/install_libzmq.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
#!/usr/bin/env bash
# script to install libzmq/libsodium for use in wheels
echo $PATH
env | grep CIBW
env | grep -I ios
env | grep MAC
env | grep SDK

set -ex

LIBSODIUM_VERSION=$(python buildutils/bundle.py libsodium)
LIBZMQ_VERSION=$(python buildutils/bundle.py)
PYZMQ_DIR="$PWD"
LICENSE_DIR="$PYZMQ_DIR/licenses"
test -d "$LICENSE_DIR" || mkdir "$LICENSE_DIR"
SHLIB_EXT=".so"
if [[ "$(uname)" == "Darwin" ]]; then
if [[ "$(uname)" == "Darwin" && "${CIBW_PLATFORM:-macos}" == "macos" ]]; then
SHLIB_EXT=".dylib"
# make sure deployment target is set
echo "${MACOSX_DEPLOYMENT_TARGET=}"
Expand All @@ -33,7 +40,7 @@ if [[ "$(uname)" == "Darwin" ]]; then
exit 1
;;
esac
echo "building libzmq for mac ${ARCHS}"
echo "building libzmq for ${CIBW_PLATFORM:-macos} ${ARCHS}"
export CXX="${CC:-clang++}"
for arch in ${ARCHS}; do
# seem to need ARCH in CXX for libtool
Expand All @@ -42,6 +49,9 @@ if [[ "$(uname)" == "Darwin" ]]; then
export CXXFLAGS="-arch ${arch} ${CXXFLAGS:-}"
export LDFLAGS="-arch ${arch} ${LDFLAGS:-}"
done
elif [[ "${CIBW_PLATFORM:-}" == "ios" ]]; then
echo "building libzmq for ${CIBW_PLATFORM}"
SHLIB_EXT=".dylib"
fi

PREFIX="${ZMQ_PREFIX:-/usr/local}"
Expand Down