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

0.9.1 and newer generate IDs that require -Wl,-headerpad_max_install_names #147

Open
atwilso opened this issue Feb 2, 2022 · 2 comments
Labels

Comments

@atwilso
Copy link
Contributor

atwilso commented Feb 2, 2022

Bug: delocate-wheel 0.9.1 or newer causes install_name_tool to error out on some libraries with the following error:

Traceback (most recent call last):

    File "/Users/atwilso/anaconda3/envs/tracktable-build-python3.7/bin/delocate-wheel", line 10, in <module>
      sys.exit(main())
    File "/Users/atwilso/anaconda3/envs/tracktable-build-python3.7/lib/python3.7/site-packages/delocate/cmd/delocate_wheel.py", line 99, in main
      ignore_missing=opts.ignore_missing_dependencies,
    File "/Users/atwilso/anaconda3/envs/tracktable-build-python3.7/lib/python3.7/site-packages/delocate/delocating.py", line 582, in delocate_wheel
      set_install_id(copied_path, install_id_root + lib_base)
    File "/Users/atwilso/anaconda3/envs/tracktable-build-python3.7/lib/python3.7/site-packages/delocate/tools.py", line 110, in modify
      return f(filename, *args, **kwargs)
    File "/Users/atwilso/anaconda3/envs/tracktable-build-python3.7/lib/python3.7/site-packages/delocate/tools.py", line 306, in set_install_id
      back_tick(['install_name_tool', '-id', install_id, filename])
    File "/Users/atwilso/anaconda3/envs/tracktable-build-python3.7/lib/python3.7/site-packages/delocate/tools.py", line 60, in back_tick
      cmd_str, retcode, err.decode('latin-1')))

  RuntimeError: install_name_tool -id /DLC/tracktable/libboost_atomic.dylib
  /private/var/folders/dt/9gwr5c3j3nn6jqfwgz9whk5h000bm6/T/tmpwf4matlk/wheel/tracktable/.dylibs/libboost_atomic.dylib
  returned code 1 with error error:
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool:
  changing install names or rpaths can't be redone for:
  /private/var/folders/dt/9gwr5c3j3nn6jqfwgz9whk5h000bm6/T/tmpwf4matlk/wheel/tracktable/.dylibs/libboost_atomic.dylib
  (for architecture x86_64) because larger updated load commands do not fit
  (the program must be relinked, and you may need to use -headerpad or
  -headerpad_max_install_names)

There are a bunch of libraries in the wheel. Most of them get processed without incident. There's just something special about libboost_atomic that runs into this size limit.

If this were happening in the code I build myself, I could just add the magic linker flag myself. However, Boost is installed via Anaconda and I don't control their build configuration.

I'm building against a Conda environment containing CPython 3.7.10 and Boost 1.75, both installed from conda-forge.

To reproduce:

delocate-wheel test-wheel.whl with delocate 0.9.1 or newer.

I have a wheel file I can supply for debugging. It's 31MB and Github won't let me attach it to this message. Contact me and I'll arrange to get it to you.

Platform:

  • MacOS 10.15.7
  • Delocate 0.9.1, 0.10.2
@atwilso atwilso added the bug label Feb 2, 2022
@HexDecimal
Copy link
Collaborator

I can't find much info on this. How the library is built might be affected by your version of Xcode, so see if you can update that and rebuild.

If libboost_atomic.dylib is deliberately built without padding then I don't think Delocate can do anything about it.

@atwilso
Copy link
Contributor Author

atwilso commented Feb 2, 2022

I don't think it's my compiler version. The libraries that I built myself get processed by delocate-wheel with no fuss.

I don't have any control at all over how libboost_atomic.dylib is built. I suspect that it isn't being created deliberately without padding because several other Boost libraries are included in this wheel and get processed with no fuss.

I could theoretically work around this by building Boost from source myself, but that involves a major revamp of my CI pipeline. Also, there's a lifetime limit on how many times a body can build Boost from source before the universe collapses, and I'm pushing it as it is...

Is it possible to find out how much room for install_name changes is available in any particular binary? Is it possible to have delocate generate shorter names?

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