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

cibuildwheel fails to repair wheel on macos-13 (x86_64) (updating from 2.16.5 to 2.22.0) #2115

Closed
mwestphal opened this issue Dec 22, 2024 · 7 comments

Comments

@mwestphal
Copy link

Description

I'm using cibuildwheel to generate wheels for a range of Python version.
I want to add support for Python 3.13 so I've updated the cibuildwheel action, however it fails only on macos-13 (x86_64) with:

  + delocate-wheel --require-archs x86_64 -w /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/cibw-run-mt9nw7ov/cp39-macosx_x86_64/repaired_wheel -v /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/cibw-run-mt9nw7ov/cp39-macosx_x86_64/built_wheel/f3d-2.5.1.post1.dev213-cp39-cp39-macosx_10_9_x86_64.whl
  INFO:delocate.delocating:Copying library /usr/local/Cellar/libdeflate/1.23/lib/libdeflate.0.dylib to f3d/.dylibs/libdeflate.0.dylib
  INFO:delocate.delocating:Modifying install name in f3d/lib/libf3d.dylib from /usr/local/opt/libdeflate/lib/libdeflate.0.dylib to @loader_path/../.dylibs/libdeflate.0.dylib
  INFO:delocate.delocating:Modifying install name in f3d/pyf3d.cpython-39-darwin.so from @rpath/libf3d.dylib to @loader_path/lib/libf3d.dylib
  INFO:delocate.tools:Sanitize: Deleting rpath '@loader_path' from '/private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/lib/libf3d.dylib'
  Fixing: /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/cibw-run-mt9nw7ov/cp39-macosx_x86_64/built_wheel/f3d-2.5.1.post1.dev213-cp39-cp39-macosx_10_9_x86_64.whl
  Traceback (most recent call last):
    File "/private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/cibw-run-mt9nw7ov/cp39-macosx_x86_64/build/venv/bin/delocate-wheel", line 8, in <module>
      sys.exit(main())
    File "/private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/cibw-run-mt9nw7ov/cp39-macosx_x86_64/build/venv/lib/python3.9/site-packages/delocate/cmd/delocate_wheel.py", line 116, in main
      copied = delocate_wheel(
    File "/private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/cibw-run-mt9nw7ov/cp39-macosx_x86_64/build/venv/lib/python3.9/site-packages/delocate/delocating.py", line 1090, in delocate_wheel
      out_wheel_fixed = _check_and_update_wheel_name(
    File "/private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/cibw-run-mt9nw7ov/cp39-macosx_x86_64/build/venv/lib/python3.9/site-packages/delocate/delocating.py", line 925, in _check_and_update_wheel_name
      raise DelocationError(
  delocate.libsana.DelocationError: Library dependencies do not satisfy target MacOS version 10.9:
  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/.dylibs/libdeflate.0.dylib has a minimum target of 13.0
  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/lib/libf3d.dylib has a minimum target of 10.15
  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/lib/libdeflate.0.dylib has a minimum target of 13.0
  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/pyf3d.cpython-39-darwin.so has a minimum target of 10.15
  Set the environment variable 'MACOSX_DEPLOYMENT_TARGET=13.0' to update minimum supported macOS for this wheel.

Build log

https://github.com/f3d-app/f3d-superbuild/actions/runs/12453096039/job/34762814882?pr=213

CI config

https://github.com/f3d-app/f3d-superbuild/blob/8c448be2fec6df62bcc66b85d80637a6c5b9bc1a/.github/actions/wheels/action.yml

@mwestphal
Copy link
Author

mwestphal commented Dec 22, 2024

I see other related issues but they all seems to struggle with arm64 which is not my case:

@mwestphal mwestphal changed the title cibuildwheel fails to repair wheel on macos-13 (updating from 2.16.5 to 2.22.0 cibuildwheel fails to repair wheel on macos-13 (x86_64) (updating from 2.16.5 to 2.22.0 Dec 22, 2024
@mwestphal mwestphal changed the title cibuildwheel fails to repair wheel on macos-13 (x86_64) (updating from 2.16.5 to 2.22.0 cibuildwheel fails to repair wheel on macos-13 (x86_64) (updating from 2.16.5 to 2.22.0) Dec 22, 2024
@mwestphal
Copy link
Author

I seem to have exactly the same issue as this one: https://datastax-oss.atlassian.net/browse/PYTHON-1396

@mwestphal
Copy link
Author

It looks like setting CMAKE_OSX_DEPLOYMENT_TARGET to 13.0 instead of 10.15 should fix it, however I dont understand why this needed now and I'm afraid that some users may still be using an old version of MacOS.

@Czaki
Copy link
Contributor

Czaki commented Dec 22, 2024

The last par of the log:

  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/.dylibs/libdeflate.0.dylib has a minimum target of 13.0
  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/lib/libf3d.dylib has a minimum target of 10.15
  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/lib/libdeflate.0.dylib has a minimum target of 13.0
  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/pyf3d.cpython-39-darwin.so has a minimum target of 10.15

The problem is with libdeflate.0.dylib, but I cannot find how you build/install it.

If it is system one, you need to build it from source with set build target to 10.15.

@mwestphal
Copy link
Author

The last par of the log:

  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/.dylibs/libdeflate.0.dylib has a minimum target of 13.0
  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/lib/libf3d.dylib has a minimum target of 10.15
  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/lib/libdeflate.0.dylib has a minimum target of 13.0
  /private/var/folders/9f/9p4dh6hs5yddrk7drxq8rc_80000gn/T/tmpp4und9jv/wheel/f3d/pyf3d.cpython-39-darwin.so has a minimum target of 10.15

The problem is with libdeflate.0.dylib, but I cannot find how you build/install it.

If it is system one, you need to build it from source with set build target to 10.15.

Its defintely from the system. Why would that be needed now what it was not needed before ?

@Czaki
Copy link
Contributor

Czaki commented Dec 22, 2024

Its defintely from the system. Why would that be needed now what it was not needed before ?

Because cibuildwheel is pinning delocate and the older version was not validating this part of the wheel.

On macOS, every binary specifies the minimum OS version for which it will work without any problem. It may be possible that a binary requiring never version of OS will work on newer system, but it may fail at any moment by calling an unsupported system call.

So newer version of delocate (so cibuildweel) start validating it to prevent such failures.

@mwestphal
Copy link
Author

Alright, so it probably means that my wheels where previously potentially incorrect. Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants