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

This function does not support separate values per-architecture: 'i386' #153

Open
alexsavulescu opened this issue Jul 1, 2022 · 2 comments
Labels

Comments

@alexsavulescu
Copy link

alexsavulescu commented Jul 1, 2022

Describe the bug
running delocate-wheel for an arm64-only wheel with universal2 python installation:

otool: /opt/X11/lib/libSM.6.dylib
Traceback (most recent call last):
  File "/Users/savulesc/Workspace/nrn/nrn_build_venv38_-2850068/bin/delocate-wheel", line 8, in <module>
    sys.exit(main())
  File "/Users/savulesc/Workspace/nrn/nrn_build_venv38_-2850068/lib/python3.8/site-packages/delocate/cmd/delocate_wheel.py", line 128, in main
    copied = delocate_wheel(
  File "/Users/savulesc/Workspace/nrn/nrn_build_venv38_-2850068/lib/python3.8/site-packages/delocate/delocating.py", line 643, in delocate_wheel
    copied_libs = delocate_path(
  File "/Users/savulesc/Workspace/nrn/nrn_build_venv38_-2850068/lib/python3.8/site-packages/delocate/delocating.py", line 465, in delocate_path
    lib_dict = tree_libs_from_directory(
  File "/Users/savulesc/Workspace/nrn/nrn_build_venv38_-2850068/lib/python3.8/site-packages/delocate/libsana.py", line 384, in tree_libs_from_directory
    return _tree_libs_from_libraries(
  File "/Users/savulesc/Workspace/nrn/nrn_build_venv38_-2850068/lib/python3.8/site-packages/delocate/libsana.py", line 309, in _tree_libs_from_libraries
    for depending_path, install_name in get_dependencies(
  File "/Users/savulesc/Workspace/nrn/nrn_build_venv38_-2850068/lib/python3.8/site-packages/delocate/libsana.py", line 105, in get_dependencies
    for install_name in get_install_names(lib_fname):
  File "/Users/savulesc/Workspace/nrn/nrn_build_venv38_-2850068/lib/python3.8/site-packages/delocate/tools.py", line 474, in get_install_names
    names_data = _check_ignore_archs(_parse_otool_install_names(otool.stdout))
  File "/Users/savulesc/Workspace/nrn/nrn_build_venv38_-2850068/lib/python3.8/site-packages/delocate/tools.py", line 324, in _check_ignore_archs
    raise NotImplementedError(
NotImplementedError: This function does not support separate values per-architecture: {'i386': [('/opt/X11/lib/libSM.6.dylib', '7.0.0', '7.1.0'), ('/opt/X11/lib/libICE.6.dylib', '10.0.0', '10.0.0'), ('/usr/lib/libSystem.B.dylib', '1.0.0', '1252.50.4')], 'x86_64': [('/opt/X11/lib/libSM.6.dylib', '7.0.0', '7.1.0'), ('/opt/X11/lib/libICE.6.dylib', '10.0.0', '10.0.0'), ('/usr/lib/libSystem.B.dylib', '1.0.0', '1311.120.1')], 'arm64': [('/opt/X11/lib/libSM.6.dylib', '7.0.0', '7.1.0'), ('/opt/X11/lib/libICE.6.dylib', '10.0.0', '10.0.0'), ('/usr/lib/libSystem.B.dylib', '1.0.0', '1311.120.1')]}

To Reproduce

delocate-wheel -w wheelhouse -v dist/*.whl. # from `build_wheels.bash` -> see `Wheels used` section

Expected behavior
delocate-wheel works

Wheels used
Attaching here.

Manual:
Install universal2 Python 3.8.10 from Python.org ; XQuartz from xquartz.org (this installs to /opt/X11 where the issue is manifesting from)
To create the wheel:

git clone git@github.com:neuronsimulator/nrn.git
cd nrn
bash packaging/python/build_static_readline_osx.bash
bash packaging/python/build_wheels.bash osx 3.8

Platform (please complete the following information):

  • OS version: macOS 12.3.1
  • Delocate version: 0.10.2

Additional context
If I pop the 'i386' from the dict passed to _check_ignore_archs it works.
wheel.zip

@HexDecimal
Copy link
Collaborator

HexDecimal commented Jul 1, 2022

I had to put them side-by-side to understand:

{  'i386': [('/opt/X11/lib/libSM.6.dylib', '7.0.0', '7.1.0'), ('/opt/X11/lib/libICE.6.dylib', '10.0.0', '10.0.0'), ('/usr/lib/libSystem.B.dylib', '1.0.0', '1252.50.4')],
 'x86_64': [('/opt/X11/lib/libSM.6.dylib', '7.0.0', '7.1.0'), ('/opt/X11/lib/libICE.6.dylib', '10.0.0', '10.0.0'), ('/usr/lib/libSystem.B.dylib', '1.0.0', '1311.120.1')],
  'arm64': [('/opt/X11/lib/libSM.6.dylib', '7.0.0', '7.1.0'), ('/opt/X11/lib/libICE.6.dylib', '10.0.0', '10.0.0'), ('/usr/lib/libSystem.B.dylib', '1.0.0', '1311.120.1')]}

I personally wasn't expecting a lib with all three architectures, although I probably should have, and it's clear that ignoring i386 would be appropriate to have this link a universal2 binary.

I'm not sure what would be best here. Based on your workaround, maybe allowing the --require-archs flag to ignore architectures outside of what's specified could work, or use the architectures of the initial in-wheel libraries to determine which ones should be ignored.

I don't have the tools to make a proper test for this, and my setup doesn't make it easy to make contributions either. At most I could approve a PR. In your case you could upload your workaround to a personal branch and tell Pip to install delocate from that.

@alexsavulescu
Copy link
Author

Thanks @HexDecimal , I will try to find some time next week to do a PR.

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

No branches or pull requests

2 participants