Skip to content

Commit 058ca1b

Browse files
authored
Add explicit error reporting to macOS dylib path patching
1 parent efa7c5c commit 058ca1b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

installer/utils/mac_utils.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function fix_dependencies {
1515
local change
1616
local short_id
1717
local install_name
18+
local thislibdir
1819
install_name=$(otool -D "$target" | tail -n +2 | grep -v '^@' || : )
1920
if [[ -n "$install_name" ]] ; then
2021
short_id=$(grealpath -e --relative-to "$prefix" "$install_name" || echo "@rpath/"$(basename "$install_name"))
@@ -24,7 +25,11 @@ function fix_dependencies {
2425
if [[ "$dep" == /System/Library/Frameworks/* || "$dep" == /usr/lib/* || "$dep" == "$install_name" ]] ; then
2526
continue;
2627
fi
27-
normalized=$(grealpath -e "$dep")
28+
thislibdir=$(dirname "$dep")
29+
normalized=$(grealpath -e --relative-to "$thislibdir" "$dep")
30+
if [[ $? != 0 ]] ; then
31+
echo "Failed to normalize path \"$dep\" relative to \"$thislibdir\" for prefix \"$prefix\" in working directory \"$PWD\""
32+
fi
2833
if [[ "$normalized" == "$prefix"/* ]] ; then
2934
relative=$(grealpath -e --relative-to "$prefix" "$normalized")
3035
change="$change -change \"$dep\" \"$subst/$relative\""

0 commit comments

Comments
 (0)