macOS: Remove duplicate RPATHs (#21244)
* Package: fix formatting. * Package: correct printing of directory being processed. * Package: remove duplicate RPATHs for macOS builds. * Package: note the additional issue affecting RPATHs in the bundle script.
This commit is contained in:
@@ -41,6 +41,7 @@ find . -name "*.pyc" -type f -delete
|
||||
# fix problematic rpaths and reexport_dylibs for signing
|
||||
# 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
|
||||
|
||||
# build and install the launcher
|
||||
|
||||
@@ -52,9 +52,9 @@ def change_reexport_dylib(file_path, reexport_dylib):
|
||||
|
||||
def scan_directory(directory, recursive=False):
|
||||
if recursive:
|
||||
print(f"Recursively scanning dir: {scan_path}")
|
||||
print(f"Recursively scanning dir: {directory}")
|
||||
else:
|
||||
print(f"Scanning dir: {scan_path}")
|
||||
print(f"Scanning dir: {directory}")
|
||||
|
||||
for filename in os.listdir(directory):
|
||||
full_path = os.path.join(directory, filename)
|
||||
@@ -71,16 +71,21 @@ def scan_directory(directory, recursive=False):
|
||||
continue
|
||||
|
||||
file_dir = os.path.dirname(full_path)
|
||||
rpaths_processed = set()
|
||||
for rpath in rpaths:
|
||||
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)
|
||||
rpaths_processed.add(rpath)
|
||||
for reexport_dylib in reexport_dylibs:
|
||||
if os.path.isabs(reexport_dylib):
|
||||
if scanmode:
|
||||
print(f'\nFound absolute path inLC_REEXPORT_DYLIB: {reexport_dylib}\nIn: {full_path}')
|
||||
print(f'\nFound absolute path in LC_REEXPORT_DYLIB: {reexport_dylib}\nIn: {full_path}')
|
||||
else:
|
||||
change_reexport_dylib(full_path, reexport_dylib)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user