From a279195601acf1b96ee64ac4a6ca8b67351922e2 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sat, 2 Aug 2025 19:44:59 -0700 Subject: [PATCH 01/15] skip other wheels, tests --- .github/workflows/test.yml | 1 + .github/workflows/wheels.yml | 74 ++---------------------------------- 2 files changed, 4 insertions(+), 71 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 60f7e495f..2faeccb88 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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' }} diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 75eb7478c..52f267f53 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -73,78 +73,10 @@ jobs: fail-fast: false matrix: include: - - os: macos-13 - name: mac-pypy - cibw: - build: "pp*" - - - 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 From d8579b47d2e96959ea1e6be3baa05ac679ef548b Mon Sep 17 00:00:00 2001 From: Min RK Date: Sat, 2 Aug 2025 19:53:23 -0700 Subject: [PATCH 02/15] try ios wheels --- .github/workflows/wheels.yml | 5 +++++ pyproject.toml | 7 +++++++ tools/install_libzmq.sh | 8 ++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 52f267f53..e7f622ad7 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -73,6 +73,11 @@ jobs: fail-fast: false matrix: include: + - os: macos-15 + name: ios + cibw: + platform: "ios" + # - os: macos-13 # name: mac-pypy # cibw: diff --git a/pyproject.toml b/pyproject.toml index 4f52008b0..210952852 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -186,6 +186,13 @@ repair-wheel-command = "delocate-wheel --sanitize-rpaths --require-archs {deloca ZMQ_PREFIX = "/tmp/zmq" MACOSX_DEPLOYMENT_TARGET = "10.15" +[tool.cibuildwheel.ios] +before-all = "bash tools/install_libzmq.sh" +repair-wheel-command = "delocate-wheel --sanitize-rpaths --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" + +[tool.cibuildwheel.ios.environment] +ZMQ_PREFIX = "/tmp/zmq" + [tool.cibuildwheel.windows] before-all = "python buildutils/bundle.py licenses" repair-wheel-command = """\ diff --git a/tools/install_libzmq.sh b/tools/install_libzmq.sh index 238b8c63b..4a75f44d8 100644 --- a/tools/install_libzmq.sh +++ b/tools/install_libzmq.sh @@ -7,7 +7,7 @@ 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=}" @@ -33,7 +33,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 @@ -42,6 +42,10 @@ if [[ "$(uname)" == "Darwin" ]]; then export CXXFLAGS="-arch ${arch} ${CXXFLAGS:-}" export LDFLAGS="-arch ${arch} ${LDFLAGS:-}" done + +if [[ "${CIBW_PLATFORM:-}" == "ios" ]]; then + echo "building libzmq for ${CIBW_PLATFORM}" + SHLIB_EXT=".dylib" fi PREFIX="${ZMQ_PREFIX:-/usr/local}" From 60b0535650cc2681c919109620e4c5c5a586c98b Mon Sep 17 00:00:00 2001 From: Min RK Date: Sat, 2 Aug 2025 19:54:50 -0700 Subject: [PATCH 03/15] debug env --- tools/install_libzmq.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/install_libzmq.sh b/tools/install_libzmq.sh index 4a75f44d8..48de2d9f3 100644 --- a/tools/install_libzmq.sh +++ b/tools/install_libzmq.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash # script to install libzmq/libsodium for use in wheels set -ex +env | grep CIBW +env | grep -I ios + LIBSODIUM_VERSION=$(python buildutils/bundle.py libsodium) LIBZMQ_VERSION=$(python buildutils/bundle.py) PYZMQ_DIR="$PWD" From 9deb8180030644e6bc5ea8f9c9dbf1076778f79a Mon Sep 17 00:00:00 2001 From: Min RK Date: Sat, 2 Aug 2025 19:56:29 -0700 Subject: [PATCH 04/15] elif --- tools/install_libzmq.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/install_libzmq.sh b/tools/install_libzmq.sh index 48de2d9f3..7a6439829 100644 --- a/tools/install_libzmq.sh +++ b/tools/install_libzmq.sh @@ -45,8 +45,7 @@ if [[ "$(uname)" == "Darwin" && "${CIBW_PLATFORM:-macos}" == "macos" ]]; then export CXXFLAGS="-arch ${arch} ${CXXFLAGS:-}" export LDFLAGS="-arch ${arch} ${LDFLAGS:-}" done - -if [[ "${CIBW_PLATFORM:-}" == "ios" ]]; then +elif [[ "${CIBW_PLATFORM:-}" == "ios" ]]; then echo "building libzmq for ${CIBW_PLATFORM}" SHLIB_EXT=".dylib" fi From 134c6b6743267c931ec054ecd2e7d03a826ab0e1 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 08:09:11 -0700 Subject: [PATCH 05/15] debug mac env --- tools/install_libzmq.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/install_libzmq.sh b/tools/install_libzmq.sh index 7a6439829..4cec4cd09 100644 --- a/tools/install_libzmq.sh +++ b/tools/install_libzmq.sh @@ -1,8 +1,12 @@ #!/usr/bin/env bash # script to install libzmq/libsodium for use in wheels -set -ex +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) From 57eae33ab539b2ac4e750d51f67fd51ac8cfb616 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 08:10:28 -0700 Subject: [PATCH 06/15] bundle static libzmq on ios --- pyproject.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 210952852..d5c585850 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -186,12 +186,8 @@ repair-wheel-command = "delocate-wheel --sanitize-rpaths --require-archs {deloca ZMQ_PREFIX = "/tmp/zmq" MACOSX_DEPLOYMENT_TARGET = "10.15" -[tool.cibuildwheel.ios] -before-all = "bash tools/install_libzmq.sh" -repair-wheel-command = "delocate-wheel --sanitize-rpaths --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" - [tool.cibuildwheel.ios.environment] -ZMQ_PREFIX = "/tmp/zmq" +ZMQ_PREFIX = "bundled" [tool.cibuildwheel.windows] before-all = "python buildutils/bundle.py licenses" From 3e7c38fced55ecc595107ece0c1a6709fff3b511 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 08:18:11 -0700 Subject: [PATCH 07/15] install cmake, ninja with brew for ios --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index d5c585850..8cc124d1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -186,6 +186,9 @@ repair-wheel-command = "delocate-wheel --sanitize-rpaths --require-archs {deloca ZMQ_PREFIX = "/tmp/zmq" MACOSX_DEPLOYMENT_TARGET = "10.15" +[tool.cibuildwheel.ios] +before-all = "brew install cmake ninja" + [tool.cibuildwheel.ios.environment] ZMQ_PREFIX = "bundled" From 3cd30b8a5e09437ed352001fdb435ada7d3c7c89 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 08:27:29 -0700 Subject: [PATCH 08/15] add cmake, ninja to xbuild-tools --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8cc124d1a..f246e2d9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -187,7 +187,7 @@ ZMQ_PREFIX = "/tmp/zmq" MACOSX_DEPLOYMENT_TARGET = "10.15" [tool.cibuildwheel.ios] -before-all = "brew install cmake ninja" +xbuild-tools = ["cmake", "ninja"] [tool.cibuildwheel.ios.environment] ZMQ_PREFIX = "bundled" From 2f393a341d0cc808803fef682318eb4e13835033 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 08:35:33 -0700 Subject: [PATCH 09/15] upgrade cmake --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f246e2d9a..ca7ea731a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -187,6 +187,8 @@ 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.environment] From ebc01c267488c214e3abfcc39e76c052450e0695 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 08:47:06 -0700 Subject: [PATCH 10/15] iphoneos is cross compiling, despite not saying so in cmake this is cibw-only, not sure what the right way to detect ios is, since cmake's ios detection isn't active --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c58cb7c4..e394461dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,7 +283,10 @@ if (ZMQ_PREFIX STREQUAL "bundled") # add --host for cross compiling message(STATUS "Cross: ${CMAKE_CROSSCOMPILING} $ENV{CIBW_HOST_TRIPLET}") - if(CMAKE_CROSSCOMPILING AND DEFINED ENV{CIBW_HOST_TRIPLET}) + if( + (CMAKE_CROSSCOMPILING OR CIBW_PLATFORM MATCHES "iphone.*") + 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}") message(STATUS "Cross compiling libsodium for host: $ENV{CIBW_HOST_TRIPLET} ${libsodium_configure}") From b24fccea1e16f395c1b57b6e359aae5c2795dfc2 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 08:49:08 -0700 Subject: [PATCH 11/15] set CMAKE_SYSTEM_NAME when targeting ios --- pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ca7ea731a..df54dc513 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -191,8 +191,10 @@ MACOSX_DEPLOYMENT_TARGET = "10.15" before-all = "brew upgrade cmake" xbuild-tools = ["cmake", "ninja"] -[tool.cibuildwheel.ios.environment] -ZMQ_PREFIX = "bundled" +[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" From 1aaf55b256e4f86c841a16877e80844f5db254fe Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 08:50:07 -0700 Subject: [PATCH 12/15] Revert "iphoneos is cross compiling, despite not saying so in cmake" This reverts commit ebc01c267488c214e3abfcc39e76c052450e0695. --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e394461dd..5c58cb7c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,10 +283,7 @@ if (ZMQ_PREFIX STREQUAL "bundled") # add --host for cross compiling message(STATUS "Cross: ${CMAKE_CROSSCOMPILING} $ENV{CIBW_HOST_TRIPLET}") - if( - (CMAKE_CROSSCOMPILING OR CIBW_PLATFORM MATCHES "iphone.*") - AND DEFINED ENV{CIBW_HOST_TRIPLET} - ) + 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}") message(STATUS "Cross compiling libsodium for host: $ENV{CIBW_HOST_TRIPLET} ${libsodium_configure}") From df42a2e0b861cd2581c7225bcd41f0a4c7fac322 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 08:56:25 -0700 Subject: [PATCH 13/15] doesn't set CIBW_HOST_TRIPLET on ios --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c58cb7c4..cb1b60cf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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-darwin for cross compilation") + set(ENV${CIBW_HOST_TRIPLET} "arm64-apple-darwin") + 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}") From a3bda85117e731f9db932db082dc806c4b4a104b Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 08:57:54 -0700 Subject: [PATCH 14/15] ios, actually --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb1b60cf0..981f4b391 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,8 +284,8 @@ if (ZMQ_PREFIX STREQUAL "bundled") # add --host for cross compiling 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-darwin for cross compilation") - set(ENV${CIBW_HOST_TRIPLET} "arm64-apple-darwin") + 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}") From 82664368711916d5202e3963ccc373055dacbe13 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 3 Aug 2025 09:02:05 -0700 Subject: [PATCH 15/15] someday I'll figure out ENV in cmake --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 981f4b391..e1bbb1721 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,9 +283,9 @@ if (ZMQ_PREFIX STREQUAL "bundled") # add --host for cross compiling message(STATUS "Checking cross compilation config: cross=${CMAKE_CROSSCOMPILING} host=$ENV{CIBW_HOST_TRIPLET}") - if(IOS AND NOT 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") + 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}")