You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shipping dependencies is essential for portability. Hashing the name is also a good practice to avoid collisions when loading several modules relying on different versions of the same library. Still, in some cases it is strictly necessary to be able to load a library dependency only once and share it between modules. For instance, it is how the interoperability of boost::python works under the hood. So far, I made a custom patch that I'm using in production since more than a year without issue:
copylib_orig = auditwheel.repair.copylib
def copylib(src_path: str, dest_dir: str,
patcher: ElfPatcher) -> Tuple[str, str]:
# Do NOT hash filename to make it unique in the particular case of boost
# python modules, since otherwise it will be impossible to share a common
# registry, which is necessary for cross module interoperability.
if "libboost_python" in src_path:
src_name = os.path.basename(src_path)
dest_path = os.path.join(dest_dir, src_name)
if os.path.exists(dest_path):
return src_name, dest_path
logger.debug('Grafting: %s -> %s', src_path, dest_path)
shutil.copy2(src_path, dest_path)
rpaths = elf_read_rpaths(src_path)
statinfo = os.stat(dest_path)
if not statinfo.st_mode & stat.S_IWRITE:
os.chmod(dest_path, statinfo.st_mode | stat.S_IWRITE)
patcher.set_soname(dest_path, src_name)
if any(itertools.chain(rpaths['rpaths'], rpaths['runpaths'])):
patcher.set_rpath(dest_path, dest_dir)
return src_name, dest_path
return copylib_orig(src_path, dest_dir, patcher)
auditwheel.repair.copylib = copylib
May be it would be beneficial to other users facing a similar issue to add this option in auditwheel itself. I can understand that it is going against the very principle of auditwheel to some extent since it may break packages that are relying on incompatible versions, but it is absolutely necessary in some cases. Besides, boost::python is extremely stable and not really making any progress since years, so I think it is quite safe at least for this particular case.
The text was updated successfully, but these errors were encountered:
duburcqa
changed the title
Feature request: add option to disable hashing the libary name of the dependencies
Feature request: add option to disable name mangling for some dependencies
May 12, 2022
duburcqa
changed the title
Feature request: add option to disable name mangling for some dependencies
Feature request: add option to disable name mangling selectively
May 12, 2022
Shipping dependencies is essential for portability. Hashing the name is also a good practice to avoid collisions when loading several modules relying on different versions of the same library. Still, in some cases it is strictly necessary to be able to load a library dependency only once and share it between modules. For instance, it is how the interoperability of boost::python works under the hood. So far, I made a custom patch that I'm using in production since more than a year without issue:
May be it would be beneficial to other users facing a similar issue to add this option in
auditwheel
itself. I can understand that it is going against the very principle ofauditwheel
to some extent since it may break packages that are relying on incompatible versions, but it is absolutely necessary in some cases. Besides,boost::python
is extremely stable and not really making any progress since years, so I think it is quite safe at least for this particular case.The text was updated successfully, but these errors were encountered: