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
Using the icu library as installed from brew install icu4c, delocate did copy the dylib files into my wheel, and adjusted the links, but it got the filenames wrong, presumably because of variation in filenames because of symlinks in the original library installation from brew. The files copied in by delocate look like this (note the 68.2 in the libicu filenames):
The main so file correctly links the the underlying libhfst library...
$ otool -L _libhfst.cpython-36m-darwin.so
_libhfst.cpython-36m-darwin.so:
@loader_path/.dylibs/libhfst.53.dylib (compatibility version 54.0.0, current version 54.0.0)
$ ls .dylibs/libhfst.53.dylib
.dylibs/libhfst.53.dylib
...and the libhfst library has correct links...
$ otool -L .dylibs/libhfst.53.dylib
.dylibs/libhfst.53.dylib:
/DLC/hfst/libhfst.53.dylib (compatibility version 54.0.0, current version 54.0.0)
@loader_path/libicui18n.68.2.dylib (compatibility version 68.0.0, current version 68.2.0)
@loader_path/libicuuc.68.2.dylib (compatibility version 68.0.0, current version 68.2.0)
@loader_path/libicudata.68.2.dylib (compatibility version 68.0.0, current version 68.2.0)
...but the libicu libraries link to one another with incorrect filenames (note the 68 instead of 68.2)...
$ otool -L .dylibs/libicu*
.dylibs/libicudata.68.2.dylib:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
.dylibs/libicui18n.68.2.dylib:
@loader_path/libicuuc.68.dylib (compatibility version 68.0.0, current version 68.2.0)
@loader_path/libicudata.68.dylib (compatibility version 68.0.0, current version 68.2.0)
.dylibs/libicuuc.68.2.dylib:
@loader_path/libicudata.68.dylib (compatibility version 68.0.0, current version 68.2.0)
I was able to postprocess this correctly with the following bash script, but implementing similar logic in delocate would be the ideal solution.
$ cat macos_fix_links.sh
#!/bin/bash# The links in the dylib files do not match the actual filenames.# This script automatically renames the links using `install_name_tool`.set -x
wheel_dir=$1
wheel_fname=$2pushd${wheel_dir}
unzip -d tmp/ ${wheel_fname}cd tmp/hfst/.dylibs/
foreach_dylibin libhfst*.dylib libicu*.dylib;doforlinkin$(otool -L ${each_dylib}| tail -n +2 | grep libicu | sed "s/(.*)//g"| sed "s/\s+//g");do# get the actual filename
link_fname=$(ls "$(echo ${link}| rev | cut -d "/" -f 1 | rev | cut -d "." -f 1)"*)
new_link=$(echo ${link}| sed "s#libicu.*\.dylib#${link_fname}#g")
sudo install_name_tool -change ${link}${new_link}${each_dylib}donedonecd ../..
# zip new wheel
zip -r ${wheel_fname}*# overwrite the original wheel
mv ${wheel_fname}${wheel_dir}# go back to where we startedpopd
The text was updated successfully, but these errors were encountered:
Using the
icu
library as installed frombrew install icu4c
,delocate
did copy thedylib
files into my wheel, and adjusted the links, but it got the filenames wrong, presumably because of variation in filenames because of symlinks in the original library installation frombrew
. The files copied in bydelocate
look like this (note the68.2
in thelibicu
filenames):The main
so
file correctly links the the underlyinglibhfst
library......and the
libhfst
library has correct links......but the
libicu
libraries link to one another with incorrect filenames (note the68
instead of68.2
)...$ otool -L .dylibs/libicu* .dylibs/libicudata.68.2.dylib: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1) .dylibs/libicui18n.68.2.dylib: @loader_path/libicuuc.68.dylib (compatibility version 68.0.0, current version 68.2.0) @loader_path/libicudata.68.dylib (compatibility version 68.0.0, current version 68.2.0) .dylibs/libicuuc.68.2.dylib: @loader_path/libicudata.68.dylib (compatibility version 68.0.0, current version 68.2.0)
I was able to postprocess this correctly with the following bash script, but implementing similar logic in
delocate
would be the ideal solution.The text was updated successfully, but these errors were encountered: