CI: recursively fixup RPATHs on macOS.

This commit is contained in:
Jacob Oursland
2025-07-29 01:42:26 -07:00
parent 83a7d3c456
commit 9e8371f91c
2 changed files with 9 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ find . -name "*.pyc" -type f -delete
# see https://github.com/FreeCAD/FreeCAD/issues/10144#issuecomment-1836686775
# and https://github.com/FreeCAD/FreeCAD-Bundle/pull/203
# and https://github.com/FreeCAD/FreeCAD-Bundle/issues/375
python ../scripts/fix_macos_lib_paths.py ${conda_env}/lib
python ../scripts/fix_macos_lib_paths.py ${conda_env}/lib -r
# build and install the launcher
cmake -B build launcher

View File

@@ -73,14 +73,20 @@ def scan_directory(directory, recursive=False):
file_dir = os.path.dirname(full_path)
rpaths_processed = set()
for rpath in rpaths:
if rpath == "@loader_path":
rpath = "@loader_path/"
if os.path.isabs(rpath) and os.path.samefile(file_dir, rpath):
if scanmode:
print(f'\nFound absolute path in LC_RPATH: {rpath}\nIn: {full_path}')
else:
remove_rpath(full_path, rpath)
if rpath in rpaths_processed:
print(f'\nFound duplicate RPATH: {rpath}\nIn: {full_path}')
remove_rpath(full_path, rpath)
if scanmode:
print(f'\nFound duplicate RPATH: {rpath}\nIn: {full_path}')
else:
remove_rpath(full_path, rpath)
rpaths_processed.add(rpath)
for reexport_dylib in reexport_dylibs:
if os.path.isabs(reexport_dylib):