matthew-brett / delocate

Find and copy needed dynamic libraries into python wheels
BSD 2-Clause "Simplified" License
266 stars 58 forks source link

Delocate Fails on File in CMake #105

Closed ax3l closed 3 years ago

ax3l commented 3 years ago

Hi,

I am working on building CMake wheels with cibuildwheel.

While running delocate on the final wheel, delocate/tools.py seems to parse a binary file inside CMake (Modules/Internal/CPack/CPack.OSXScriptLauncher.in) and aborts:

  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/delocate/libsana.py", line 59, in tree_libs
    rpaths = get_rpaths(depending_libpath)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/delocate/tools.py", line 315, in get_rpaths
    if not _line0_says_object(lines[0], filename):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/delocate/tools.py", line 192, in _line0_says_object
    raise InstallNameError('Unexpected first line: ' + line0)
delocate.tools.InstallNameError: Unexpected first line: /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpv9p0uzl8/cmake/data/CMake.app/Contents/share/cmake-3.18/Modules/Internal/CPack/CPack.OSXScriptLauncher.in (architecture ppc):

The file in question is here: https://github.com/Kitware/CMake/blob/v3.20.2/Modules/Internal/CPack/CPack.OSXScriptLauncher.in

Ref.: https://github.com/ax3l/cmake-cibuildwheel/runs/2579731904?check_suite_focus=true

Existing macOS wheels for testing: https://pypi.org/project/cmake/#files

isuruf commented 3 years ago

Fixed in https://github.com/matthew-brett/delocate/pull/115

ax3l commented 3 years ago

Thanks a lot! :tada: