matthew-brett / delocate

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

Use case where setting /DLC link is breaking functionality #152

Open atalman opened 2 years ago

atalman commented 2 years ago

Hi,

This issue is a followup to this discussion that explain this code in delocate :

_make_install_name_ids_unique(
            libraries=libraries_in_lib_path,
            install_id_prefix=DLC_PREFIX + relpath(lib_sdir, wheel_dir),
        )

Ref: https://github.com/matthew-brett/delocate/blob/master/delocate/delocating.py#L669

However we stumbled upon this ssue 74120 in our project. We package libiomp5.dylib in our project with original ID of @rpath/libiomp5.dylib . We run delocate on our wheel and delocate changes this ID to /DLC/torch/.dylibs/libiomp5.dylib

When a developer tries to use our wheel and load our lib from Java code. And it fails see issue 74120

This issue can bi mitigated by running install_name tool like this:

install_name_tool -id "@rpath/libiomp5.dylib" libiomp5.dylib

Based on the above I have following questions:

1) Is it possible to add an option argument parameter to delocate to not make install name ids unique ? So we can deal with issues like the above. 2) Do you have any suggestion for us on how to deal with this use case, without having to fork delocate code ?

cc @malfet