delocate: Can't delocate wheel with AttributeError after a regex returns no match in `parse_install_name`.

I’m running delocate on github actions on a osx build and it errors out with the following error:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/delocate-wheel", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/cmd/delocate_wheel.py", line 71, in main
    check_verbose=opts.verbose)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 377, in delocate_wheel
    lib_filt_func, copy_filt_func)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 289, in delocate_path
    return copy_recurse(lib_path, copy_filt_func, copied)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 145, in copy_recurse
    _copy_required(lib_path, copy_filt_func, copied_libs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 201, in _copy_required
    lib_dict = tree_libs(lib_path)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/libsana.py", line 60, in tree_libs
    for install_name in get_install_names(depending_libpath):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/tools.py", line 219, in get_install_names
    names = tuple(parse_install_name(line)[0] for line in lines[1:])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/tools.py", line 219, in <genexpr>
    names = tuple(parse_install_name(line)[0] for line in lines[1:])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/tools.py", line 151, in parse_install_name
    return IN_RE.match(line).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

The command I’m running is delocate-wheel dist/*.whl, and the result of ls dist/ prints ffpyplayer-4.3.2.dev0-cp36-cp36m-macosx_10_9_x86_64.whl indicating that the file is there.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (3 by maintainers)

Commits related to this issue

Most upvoted comments

You can always build wheels for the two architectures, delocate them, and then fuse them into one wheel with the delocate-fuse command.

That’s perfect, showing the otool output makes it clear what happened.

https://github.com/matthew-brett/delocate/blob/9c2c6a42c96b02602ce8d2059423a77e257a1a98/delocate/tools.py#L252

This code here removes only the first line which is supposed to be the “architecture” line and then doesn’t expect there to be a 2nd architecture. This seems to cause the current error.

Right now I don’t know what the correct way of handling this is supposed to be. I’d guess ignoring the separate architectures and merging the sets of libraries might work. I wasn’t able to reproduce the error so I can’t write a test for this.