From bac065a692b30a172ec17dacc97cb17087cbbc6a Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 5 Dec 2024 08:59:26 +0000 Subject: [PATCH 1/7] macos-12 is dead long live arm64 --- tools/load_build_targets.py | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/tools/load_build_targets.py b/tools/load_build_targets.py index ecd2fe4..1d2df3b 100644 --- a/tools/load_build_targets.py +++ b/tools/load_build_targets.py @@ -7,10 +7,9 @@ MACHINE_TYPE = { "linux": "ubuntu-latest", - "macos": "macos-12", + "macos": "macos-latest", "windows": "windows-latest", } -M1_RUNNER = "macos-14" CIBW_BUILD = os.environ.get("CIBW_BUILD", "*") CIBW_ARCHS = os.environ.get("CIBW_ARCHS", "auto") @@ -37,10 +36,7 @@ def load_build_targets(targets): def get_os(target): if "macos" in target: - if get_cibw_archs(target) in {"arm64", "universal2"}: - return M1_RUNNER - else: - return MACHINE_TYPE["macos"] + return MACHINE_TYPE["macos"] if "win" in target: return MACHINE_TYPE["windows"] return MACHINE_TYPE["linux"] @@ -53,9 +49,29 @@ def get_cibw_build(target): def get_cibw_archs(target): - for arch in ["aarch64", "ppc64le", "s390x", "armv7l", "arm64", "universal2"]: - if target.endswith(arch): - return arch + """ + Handle non-native architectures + + cibw allows running non-native builds on various platforms: + https://cibuildwheel.pypa.io/en/stable/options/#archs + + This logic overrides the "auto" flag based on OS and a list of supported + non-native arch if a non-native arch is given for a particular platform in + targets, rather than the user having to do this manually. + """ + platform_archs = { + # We now cross compile x86_64 on arm64, although it is techincically + # still possible to get native x86_64 runner with macos-13, it's time to + # move on. + "macos": ["universal2", "x86_64"], + # This is a list of supported eumulated arches on linux + "linux": ["aarch64", "ppc64le", "s390x", "armv7l"], + } + for platform, archs in platform_archs.items(): + if platform in target: + for arch in archs: + if target.endswith(arch): + return arch return CIBW_ARCHS From 5b1bba9d9fd8d5de56b51a83a33ff53737736854 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 5 Dec 2024 09:02:48 +0000 Subject: [PATCH 2/7] Add a test --- .github/workflows/test_publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_publish.yml b/.github/workflows/test_publish.yml index 5f880e8..d28dabd 100644 --- a/.github/workflows/test_publish.yml +++ b/.github/workflows/test_publish.yml @@ -28,7 +28,10 @@ jobs: targets: | - linux - cp311-macosx_x86_64 + - target: cp311-macosx_x86_64 + runs-on: macos-13 - cp312-macosx_arm64 + - cp313-macosx_universal2 - cp3?-win_amd64 - cp312-manylinux_aarch64 - cp313-manylinux_x86_64 From a7fa20564fae59f91674fe8eb0be222b326402f8 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 5 Dec 2024 09:03:33 +0000 Subject: [PATCH 3/7] update scripts --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2bd9ae7..9439cec 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -113,7 +113,7 @@ jobs: - run: python -m pip install PyYAML click - run: echo $LOAD_BUILD_TARGETS_SCRIPT | base64 --decode > load_build_targets.py env: - LOAD_BUILD_TARGETS_SCRIPT: aW1wb3J0IGpzb24KaW1wb3J0IG9zCmltcG9ydCByZQoKaW1wb3J0IGNsaWNrCmltcG9ydCB5YW1sCgpNQUNISU5FX1RZUEUgPSB7CiAgICAibGludXgiOiAidWJ1bnR1LWxhdGVzdCIsCiAgICAibWFjb3MiOiAibWFjb3MtMTIiLAogICAgIndpbmRvd3MiOiAid2luZG93cy1sYXRlc3QiLAp9Ck0xX1JVTk5FUiA9ICJtYWNvcy0xNCIKCkNJQldfQlVJTEQgPSBvcy5lbnZpcm9uLmdldCgiQ0lCV19CVUlMRCIsICIqIikKQ0lCV19BUkNIUyA9IG9zLmVudmlyb24uZ2V0KCJDSUJXX0FSQ0hTIiwgImF1dG8iKQoKCkBjbGljay5jb21tY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tZSA9IHJlLnN1YihyIi0rIiwgIi0iLCBhcnRpZmFjdF9uYW1lKQogICAgcmV0dXJuIGFydGlmYWN0X25hbWUKCgpkZWYgZ2V0X21hdHJpeF9pdGVtKHRhcmdldCk6CiAgICBleHRyYV90YXJnZXRfYXJncyA9IHt9CiAgICBpZiBpc2luc3RhbmNlKHRhcmdldCwgZGljdCk6CiAgICAgICAgZXh0cmFfdGFyZ2V0X2FyZ3MgPSB0YXJnZXQKICAgICAgICB0YXJnZXQgPSBleHRyYV90YXJnZXRfYXJncy5wb3AoInRhcmdldCIpCiAgICByZXR1cm4gewogICAgICAgICJ0YXJnZXQiOiB0YXJnZXQsCiAgICAgICAgInJ1bnMtb24iOiBnZXRfb3ModGFyZ2V0KSwKICAgICAgICAiQ0lCV19CVUlMRCI6IGdldF9jaWJ3X2J1aWxkKHRhcmdldCksCiAgICAgICAgIkNJQldfQVJDSFMiOiBnZXRfY2lid19hcmNocyh0YXJnZXQpLAogICAgICAgICJhcnRpZmFjdC1uYW1lIjogZ2V0X2FydGlmYWN0X25hbWUodGFyZ2V0KSwKICAgICAgICAqKmV4dHJhX3RhcmdldF9hcmdzLAogICAgfQoKCmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6CiAgICBsb2FkX2J1aWxkX3RhcmdldHMoKQo= - id: set-outputs run: python load_build_targets.py --targets "${{ inputs.targets }}" shell: sh From 9bc9f054d01ef9101c85fc4d7bea120b70472690 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 5 Dec 2024 09:12:21 +0000 Subject: [PATCH 4/7] Use macos-13 for old pythons --- .github/workflows/test_tox.yml | 1 + .github/workflows/tox.yml | 2 +- tools/tox_matrix.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_tox.yml b/.github/workflows/test_tox.yml index 4e53239..868baad 100644 --- a/.github/workflows/test_tox.yml +++ b/.github/workflows/test_tox.yml @@ -20,6 +20,7 @@ jobs: envs: | - linux: py312-inputs-linux - macos: py311-inputs-macos + - macos: py39-inputs-macos - windows: py310-inputs-windows toxargs: '-v' runs-on: windows-2019 diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 23cdd3a..8bd9ecd 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -126,7 +126,7 @@ jobs: - run: python -m pip install PyYAML click packaging - run: echo $TOX_MATRIX_SCRIPT | base64 --decode > tox_matrix.py env: - TOX_MATRIX_SCRIPT: aW1wb3J0IGpzb24KaW1wb3J0IG9zCmltcG9ydCByZQoKaW1wb3J0IGNsaWNrCmltcG9ydCB5YW1sCmZyb20gcGFja2FnaW5nLnZlcnNpb24gaW1wb3J0IEludmFsaWRWZXJzaW9uLCBWZXJzaW9uCgoKQGNsaWNrLmNvbW1hbmQoKQpAY2xpY2sub3B0aW9uKCItLWVudnMiLCBkZWZhdWx0PSIiKQpAY2xpY2sub3B0aW9uKCItLWxpYnJhcmllcyIsIGRlZmF1bHQ9IiIpCkBjbGljay5vcHRpb24oIi0tcG9zYXJncyIsIGRlZmF1bHQ9IiIpCkBjbGljay5vcHRpb24oIi0tdG94ZGVwcyIsIGRlZmF1bHQ9IiIpCkBjbGljay5vcHRpb24oIi0tdG94YXJncyIsIGRlZmF1bHQ9IiIpCkBjbGljay5vcHRpb24oIi0tcHl0ZXN0IiwgZGVmYXVsdD0idHJ1ZSIpCkBjbGljay5vcHRpb24oIi0tcHl0ZXN0LXJlc3VsdHMtc3VtbWFyeSIsIGRlZmF1bHQ9ImZhbHNlIikKQGNsaWNrLm9wdGlvbigiLS1jb3ZlcmFnZSIsIGRlZmF1bHQ9IiIpCkBjbGljay5vcHRpb24oIi0tY29uZGEiLCBkZWZhdWx0PSJhdXRvIikKQGNsaWNrLm9wdGlvbigiLS1zZXRlbnYiLCBkZWZhdWx0PSIiKQpAY2xpY2sub3B0aW9uKCItLWRpc3BsYXkiLCBkZWZhdWx0PSJmYWxzZSIpCkBjbGljay5vcHRpb24oIi0tY2FjaGUtcGF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ogW10sCiAgICAgICAgImJyZXctY2FzayI6IFtdLAogICAgICAgICJhcHQiOiBbXSwKICAgICAgICAiY2hvY28iOiBbXSwKICAgIH0KICAgIGxpYnJhcmllcyA9IHlhbWwubG9hZChsaWJyYXJpZXMsIExvYWRlcj15YW1sLkJhc2VMb2FkZXIpCiAgICBpZiBsaWJyYXJpZXMgaXMgbm90IE5vbmU6CiAgICAgICAgZ2xvYmFsX2xpYnJhcmllcy51cGRhdGUobGlicmFyaWVzKQogICAgcHJpbnQoanNvbi5kdW1wcyhnbG9iYWxfbGlicmFyaWVzLCBpbmRlbnQ9MikpCgogICAgIyBEZWZhdWx0IGltYWdlcyB0byB1c2UgZm9yIHJ1bm5lcnMKICAgIGRlZmF1bHRfcnVuc19vbiA9IHsKICAgICAgICAibGludXgiOiAidWJ1bnR1LWxhdGVzdCIsCiAgICAgICAgIm1hY29zIjogIm1hY29zLWxhdGVzdCIsCiAgICAgICAgIndpbmRvd3MiOiAid2luZG93cy1sYXRlc3QiLAogICAgfQogICAgY3VzdG9tX3J1bnNfb24gPSB5YW1sLmxvYWQocnVuc19vbiwgTG9hZGVyPXlhbWwuQmFzZUxvYWRlcikKICAgIGlmIGlzaW5zdGFuY2UoY3VzdG9tX3J1bnNfb24sIGRpY3QpOgogICAgICAgIGRlZmF1bHRfcnVuc19vbi51cGRhdGUoY3VzdG9tX3J1bnNfb24pCiAgICBwcmludChqc29uLmR1bXBzKGRlZmF1bHRfcnVuc19vbiwgaW5kZW50PTIpKQoKICAgICMgRGVmYXVsdCBzdHJpbmcgcGFyYW1ldGVycyB3aGljaCBjYW4gYmUgb3ZlcndyaXR0ZW4gYnkgZWFjaCBlbnYKICAgIHN0cmluZ19wYXJhbWV0ZXJzID0gewogICAgICAgICJwb3NhcmdzIjogcG9zYXJncywKICAgICAgICAidG94ZGVwcyI6IHRveGRlcHMsCiAgICAgICAgInRveGFyZ3MiOiB0b3hhcmdzLAogICAgICAgICJweXRlc3QiOiBweXRlc3QsCiAgICAgICAgInB5dGVzdC1yZXN1bHRzLXN1bW1hcnkiOiBweXRlc3RfcmVzdWx0c19zdW1tYXJ5LAogICAgICAgICJjb3ZlcmFnZSI6IGNvdmVyYWdlLAogICAgICAgICJjb25kYSI6IGNvbmRhLAogICAgICAgICJzZXRlbnYiOiBzZXRlbnYsCiAgICAgICAgImRpc3BsYXkiOiBkaXNwbGF5LAogICAgICAgICJjYWNoZS1wYXRoIjogY2FjaGVfcGF0aCwKICAgICAgICAiY2FjaGUta2V5IjogY2FjaGVfa2V5LAogICAgICAgICJjYWNoZS1yZXN0b3JlLWtleXMiOiBjYWNoZV9yZXN0b3JlX2tleXMsCiAgICAgICAgImFydGlmYWN0LXBhdGgiOiBhcnRpZmFjdF9wYXRoLAogICAgICAgICJ0aW1lb3V0LW1pbnV0ZXMiOiB0aW1lb3V0X21pbnV0ZXMsCiAgICB9CgogICAgIyBDcmVhdGUgbWF0cml4CiAgICBtYXRyaXggPSB7ImluY2x1ZGUiOiBbXX0KICAgIGZvciBlbnYgaW4gZW52czoKICAgICAgICBtYXRyaXhbImluY2x1ZGUiXS5hcHBlbmQoZ2V0X21hdHJpeF9pdGVtKAogICAgICAgICAgICBlbnYsCiAgICAgICAgICAgIGdsb2JhbF9saWJyYXJpZXM9Z2xvYmFsX2xpYnJhcmllcywKICAgICAgICAgICAgZ2xvYmFsX3N0cmluZ19wYXJhbWV0ZXJzPXN0cmluZ19wYXJhbWV0ZXJzLAogICAgICAgICAgICBydW5zX29uPWRlZmF1bHRfcnVuc19vbiwKICAgICAgICAgICAgZGVmYXVsdF9weXRob249ZGVmYXVsdF9weXRob24sCiAgICAgICAgKSkKCiAgICAjIE91dHB1dCBtYXRyaXgKICAgIHByaW50KGpzb24uZHVtcHMobWF0cml4LCBpbmRlbnQ9MikpCiAgICB3aXRoIG9wZW4ob3MuZW52aXJvblsiR0lUSFVCX09VVFBVVCJdLCAiYSIpIGFzIGY6CiAgICAgICAgZi53cml0ZShmIm1hdHJpeD17anNvbi5kdW1wcyhtYXRyaXgpfVxuIikKCgpkZWYgZ2V0X21hdHJpeF9pdGVtKGVudiwgZ2xvYmFsX2xpYnJhcmllcywgZ2xvYmFsX3N0cmluZ19wYXJhbWV0ZXJzLAogICAgICAgICAgICAgICAgICAgIHJ1bnNfb24sIGRlZmF1bHRfcHl0aG9uKToKCiAgICAjIGRlZmluZSBzcGVjIGZvciBlYWNoIG1hdHJpeCBpbmNsdWRlICgrIGdsb2JhbF9zdHJpbmdfcGFyYW1ldGVycykKICAgIGl0ZW0gPSB7CiAgICAgICAgIm9zIjogTm9uZSwKICAgICAgICAidG94ZW52IjogTm9uZSwKICAgICAgICAicHl0aG9uX3ZlcnNpb24iOiBOb25lLAogICAgICAgICJuYW1lIjogTm9uZSwKICAgICAgICAicHl0ZXN0X2ZsYWciOiBOb25lLAogICAgICAgICJsaWJyYXJpZXNfYnJldyI6IE5vbmUsCiAgICAgICAgImxpYnJhcmllc19icmV3X2Nhc2siOiBOb25lLAogICAgICAgICJsaWJyYXJpZXNfYXB0IjogTm9uZSwKICAgICAgICAibGlicmFyaWVzX2Nob2NvIjogTm9uZSwKICAgICAgICAiY2FjaGUtcGF0aCI6IE5vbmUsCiAgICAgICAgImNhY2hlLWtleSI6IE5vbmUsCiAgICAgICAgImNhY2hlLXJlc3RvcmUta2V5cyI6IE5vbmUsCiAgICAgICAgImFydGlmYWN0LW5hbWUiOiBOb25lLAogICAgICAgICJhcnRpZmFjdC1wYXRoIjogTm9uZSwKICAgICAgICAidGltZW91dC1taW51dGVzIjogTm9uZSwKICAgIH0KICAgIGZvciBzdHJpbmdfcGFyYW0sIGRlZmF1bHQgaW4gZ2xvYmFsX3N0cmluZ19wYXJhbWV0ZXJzLml0ZW1zKCk6CiAgICAgICAgZW52X3ZhbHVlID0gZW52LmdldChzdHJpbmdfcGFyYW0pCiAgICAgICAgaXRlbVtzdHJpbmdfcGFyYW1dID0gZGVmYXVsdCBpZiBlbnZfdmFsdWUgaXMgTm9uZSBlbHNlIGVud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wYXJhbWV0ZXJzID0gewogICAgICAgICJwb3NhcmdzIjogcG9zYXJncywKICAgICAgICAidG94ZGVwcyI6IHRveGRlcHMsCiAgICAgICAgInRveGFyZ3MiOiB0b3hhcmdzLAogICAgICAgICJweXRlc3QiOiBweXRlc3QsCiAgICAgICAgInB5dGVzdC1yZXN1bHRzLXN1bW1hcnkiOiBweXRlc3RfcmVzdWx0c19zdW1tYXJ5LAogICAgICAgICJjb3ZlcmFnZSI6IGNvdmVyYWdlLAogICAgICAgICJjb25kYSI6IGNvbmRhLAogICAgICAgICJzZXRlbnYiOiBzZXRlbnYsCiAgICAgICAgImRpc3BsYXkiOiBkaXNwbGF5LAogICAgICAgICJjYWNoZS1wYXRoIjogY2FjaGVfcGF0aCwKICAgICAgICAiY2FjaGUta2V5IjogY2FjaGVfa2V5LAogICAgICAgICJjYWNoZS1yZXN0b3JlLWtleXMiOiBjYWNoZV9yZXN0b3JlX2tleXMsCiAgICAgICAgImFydGlmYWN0LXBhdGgiOiBhcnRpZmFjdF9wYXRoLAogICAgICAgICJ0aW1lb3V0LW1pbnV0ZXMiOiB0aW1lb3V0X21pbnV0ZXMsCiAgICB9CgogICAgIyBDcmVhdGUgbWF0cml4CiAgICBtYXRyaXggPSB7ImluY2x1ZGUiOiBbXX0KICAgIGZvciBlbnYgaW4gZW52czoKICAgICAgICBtYXRyaXhbImluY2x1ZGUiXS5hcHBlbmQoZ2V0X21hdHJpeF9pdGVtKAogICAgICAgICAgICBlbnYsCiAgICAgICAgICAgIGdsb2JhbF9saWJyYXJpZXM9Z2xvYmFsX2xpYnJhcmllcywKICAgICAgICAgICAgZ2xvYmFsX3N0cmluZ19wYXJhbWV0ZXJzPXN0cmluZ19wYXJhbWV0ZXJzLAogICAgICAgICAgICBydW5zX29uPWRlZmF1bHRfcnVuc19vbiwKICAgICAgICAgICAgZGVmYXVsdF9weXRob249ZGVmYXVsdF9weXRob24sCiAgICAgICAgKSkKCiAgICAjIE91dHB1dCBtYXRyaXgKICAgIHByaW50KGpzb24uZHVtcHMobWF0cml4LCBpbmRlbnQ9MikpCiAgICB3aXRoIG9wZW4ob3MuZW52aXJvblsiR0lUSFVCX09VVFBVVCJdLCAiYSIpIGFzIGY6CiAgICAgICAgZi53cml0ZShmIm1hdHJpeD17anNvbi5kdW1wcyhtYXRyaXgpfVxuIikKCgpkZWYgZ2V0X21hdHJpeF9pdGVtKGVudiwgZ2xvYmFsX2xpYnJhcmllcywgZ2xvYmFsX3N0cmluZ19wYXJhbWV0ZXJzLAogICAgICAgICAgICAgICAgICAgIHJ1bnNfb24sIGRlZmF1bHRfcHl0aG9uKToKCiAgICAjIGRlZmluZSBzcGVjIGZvciBlYWNoIG1hdHJpeCBpbmNsdWRlICgrIGdsb2JhbF9zdHJpbmdfcGFyYW1ldGVycykKICAgIGl0ZW0gPSB7CiAgICAgICAgIm9zIjogTm9uZSwKICAgICAgICAidG94ZW52IjogTm9uZSwKICAgICAgICAicHl0aG9uX3ZlcnNpb24iOiBOb25lLAogICAgICAgICJuYW1lIjogTm9uZSwKICAgICAgICAicHl0ZXN0X2ZsYWciOiBOb25lLAogICAgICAgICJsaWJyYXJpZXNfYnJldyI6IE5vbmUsCiAgICAgICAgImxpYnJhcmllc19icmV3X2Nhc2siOiBOb25lLAogICAgICAgICJsaWJyYXJpZXNfYXB0IjogTm9uZSwKICAgICAgICAibGlicmFyaWVzX2Nob2NvIjogTm9uZSwKICAgICAgICAiY2FjaGUtcGF0aCI6IE5vbmUsCiAgICAgICAgImNhY2hlLWtleSI6IE5vbmUsCiAgICAgICAgImNhY2hlLXJlc3RvcmUta2V5cyI6IE5vbmUsCiAgICAgICAgImFydGlmYWN0LW5hbWUiOiBOb25lLAogICAgICAgICJhcnRpZmFjdC1wYXRoIjogTm9uZSwKICAgICAgICAidGltZW91dC1taW51dGVzIjogTm9uZSwKICAgIH0KICAgIGZvciBzdHJpbmdfcGFyYW0sIGRlZmF1bHQgaW4gZ2xvYmFsX3N0cmluZ19wYXJhbWV0Z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RlbVsidG94ZGVwcyJdLmxvd2VyKCk6CiAgICAgICAgaXRlbVsidG94ZGVwcyJdID0gKCJ0b3gtY29uZGEgIiArIGl0ZW1bInRveGRlcHMiXSkuc3RyaXAoKQoKICAgICMgbWFrZSB0aW1lb3V0LW1pbnV0ZXMgYSBudW1iZXIKICAgIGl0ZW1bInRpbWVvdXQtbWludXRlcyJdID0gaW50KGl0ZW1bInRpbWVvdXQtbWludXRlcyJdKQoKICAgICMgdmVyaWZ5IHZhbHVlcwogICAgYXNzZXJ0IGl0ZW1bInB5dGVzdCJdIGluIHsidHJ1ZSIsICJmYWxzZSJ9CiAgICBhc3NlcnQgaXRlbVsiY29uZGEiXSBpbiB7InRydWUiLCAiZmFsc2UifQogICAgYXNzZXJ0IGl0ZW1bImRpc3BsYXkiXSBpbiB7InRydWUiLCAiZmFsc2UifQoKICAgIHJldHVybiBpdGVtCgoKaWYgX19uYW1lX18gPT0gIl9fbWFpbl9fIjoKICAgIGxvYWRfdG94X3RhcmdldHMoKQo= - run: cat tox_matrix.py - id: set-outputs run: | diff --git a/tools/tox_matrix.py b/tools/tox_matrix.py index eb27fca..3762148 100644 --- a/tools/tox_matrix.py +++ b/tools/tox_matrix.py @@ -139,7 +139,7 @@ def get_matrix_item(env, global_libraries, global_string_parameters, # if Python is <3.10 we can't use macos-latest which is arm64 try: if Version(item["python_version"]) < Version('3.10') and item["os"] == "macos-latest": - item["os"] = "macos-12" + item["os"] = "macos-13" except InvalidVersion: # python_version might be for example 'pypy-3.10' which won't parse pass From 11407752fff91f37897170f3135da56c64bb38cd Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 5 Dec 2024 10:19:08 +0000 Subject: [PATCH 5/7] Default to building arm64 and x86_64 wheels on macos --- .github/workflows/publish.yml | 2 +- .github/workflows/test_publish.yml | 2 +- tools/load_build_targets.py | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9439cec..460e29f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -113,7 +113,7 @@ jobs: - run: python -m pip install PyYAML click - run: echo $LOAD_BUILD_TARGETS_SCRIPT | base64 --decode > load_build_targets.py env: - LOAD_BUILD_TARGETS_SCRIPT: aW1wb3J0IGpzb24KaW1wb3J0IG9zCmltcG9ydCByZQoKaW1wb3J0IGNsaWNrCmltcG9ydCB5YW1sCgpNQUNISU5FX1RZUEUgPSB7CiAgICAibGludXgiOiAidWJ1bnR1LWxhdGVzdCIsCiAgICAibWFjb3MiOiAibWFjb3MtbGF0ZXN0IiwKICAgICJ3aW5kb3dzIjogIndpbmRvd3MtbGF0ZXN0IiwKfQoKQ0lCV19CVUlMRCA9IG9zLmVudmlyb24uZ2V0KCJDSUJXX0JVSUxEIiwgIioiKQpDSUJXX0FSQ0hTID0gb3MuZW52aXJvbi5nZXQoIkNJQldfQVJDSFMiLCAiYXV0byIpCgoKQGNsaWNrLmNvbW1hbmQoKQpAY2xpY2sub3B0aW9uKCItLXRhcmdldHMiLCBkZWZhdWx0PSIiKQpkZWYgbG9hZF9idWlsZF90YXJnZXRzKHRhcmdldHMpOgogICAgIiIiU2NyaXB0IHRvIGxvYWQgY2lidWlsZHdoZWVsIHRhcmdldHMgZm9yIEdpdEh1YiBBY3Rpb25zIHdvcmtmbG93LiIiIgogICAgIyBMb2FkIGxpc3Qgb2YgdGFyZ2V0cwogICAgdGFyZ2V0cyA9IHlhbWwubG9hZCh0YXJnZXRzLCBMb2FkZXI9eWFtbC5CYXNlTG9hZGVyKQogICAgcHJpbnQoanNvbi5kdW1wcyh0YXJnZXRzLCBpbmRlbnQ9MikpCgogICAgIyBDcmVhdGUgbWF0cml4CiAgICBtYXRyaXggPSB7ImluY2x1ZGUiOiBbXX0KICAgIGZvciB0YXJnZXQgaW4gdGFyZ2V0czoKICAgICAgICBtYXRyaXhbImluY2x1ZGUiXS5hcHBlbmQoZ2V0X21hdHJpeF9pdGVtKHRhcmdldCkpCg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FyZ2V0X2FyZ3MsCiAgICB9CgoKaWYgX19uYW1lX18gPT0gIl9fbWFpbl9fIjoKICAgIGxvYWRfYnVpbGRfdGFyZ2V0cygpCg== - id: set-outputs run: python load_build_targets.py --targets "${{ inputs.targets }}" shell: sh diff --git a/.github/workflows/test_publish.yml b/.github/workflows/test_publish.yml index d28dabd..1bd83b7 100644 --- a/.github/workflows/test_publish.yml +++ b/.github/workflows/test_publish.yml @@ -27,7 +27,7 @@ jobs: test_command: pytest --pyargs test_package targets: | - linux - - cp311-macosx_x86_64 + - cp311-macosx - target: cp311-macosx_x86_64 runs-on: macos-13 - cp312-macosx_arm64 diff --git a/tools/load_build_targets.py b/tools/load_build_targets.py index 1d2df3b..4078c95 100644 --- a/tools/load_build_targets.py +++ b/tools/load_build_targets.py @@ -60,9 +60,7 @@ def get_cibw_archs(target): targets, rather than the user having to do this manually. """ platform_archs = { - # We now cross compile x86_64 on arm64, although it is techincically - # still possible to get native x86_64 runner with macos-13, it's time to - # move on. + # We now cross compile x86_64 on arm64 by default "macos": ["universal2", "x86_64"], # This is a list of supported eumulated arches on linux "linux": ["aarch64", "ppc64le", "s390x", "armv7l"], @@ -72,6 +70,11 @@ def get_cibw_archs(target): for arch in archs: if target.endswith(arch): return arch + + # If no explict arch has been specified build both arm64 and x86_64 on macos + if "macos" in target: + return os.environ.get("CIBW_ARCHS", "arm64 x86_64") + return CIBW_ARCHS From 018ed86bea5e2c23776ba61bf66042126957e84e Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 5 Dec 2024 10:24:55 +0000 Subject: [PATCH 6/7] docs --- docs/source/publish.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/source/publish.rst b/docs/source/publish.rst index 2f43f36..4d28328 100644 --- a/docs/source/publish.rst +++ b/docs/source/publish.rst @@ -35,8 +35,9 @@ Any other target is assumed to be a value for the ``CIBW_BUILD`` environment variable (e.g. ``cp3?-macosx_x86_64``). In this case the OS to run cibuildwheel on is extracted from the target. -Targets that end with ``aarch64``, ``arm64`` and ``universal2`` are also -supported without any additional configuration of cibuildwheel. +Targets which end with non-native architectures such as ``aarch64`` on linux or +``x86_64`` on macos are supported and will be emulated (on linux) or cross +compiled. **Note:** ``targets`` is a *string* and must be specified as a literal block scalar using the ``|``. (Without the ``|``, it must also @@ -57,6 +58,15 @@ To not build any wheels: targets: '' +For additional configuration extra arguments can be passed by making a target a dictionary. +An example of this is specifying the runner for a target, such as building macos x86_64 wheels on native x86_64 runners: + +.. code:: yaml + + targets: + - target: cp311-macosx_x86_64 + runs-on: macos-13 + sdist ^^^^^ From e14009294c7030ed31e0056cdd7f387581d4e5e1 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 5 Dec 2024 10:27:37 +0000 Subject: [PATCH 7/7] More tests? --- .github/workflows/test_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_publish.yml b/.github/workflows/test_publish.yml index 1bd83b7..944b5ca 100644 --- a/.github/workflows/test_publish.yml +++ b/.github/workflows/test_publish.yml @@ -27,7 +27,7 @@ jobs: test_command: pytest --pyargs test_package targets: | - linux - - cp311-macosx + - cp31?-macos* - target: cp311-macosx_x86_64 runs-on: macos-13 - cp312-macosx_arm64