From 9a698e8627249519dabbf1bec39b5db9a95bf620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drik=20Fuoco?= <105517825+cedrik-fuoco-adsk@users.noreply.github.com> Date: Fri, 9 Aug 2024 11:59:58 -0400 Subject: [PATCH] Fix issue install step tries to delete rpath multiple times (MacOS ARM64) (#532) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Fix issue where it tries to delete rpath multiple times ### Linked issues n/a ### Summarize your change. Fix an issue during the install step where it tries to delete a RPATH multiple time due to a universal library. Keep a list of deleted rpath for a specific file and do not delete the same RPATH multiple time. ### Describe the reason for the change. Install step was failing on MacOS ARM64 ### Describe what you have tested and on which operating system. - [x] MacOS ARM64 ### Add a list of changes, and note any that might need special attention during the review. ### If possible, provide screenshots. Signed-off-by: CeĢdrik Fuoco --- src/build/remove_absolute_rpath.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/build/remove_absolute_rpath.py b/src/build/remove_absolute_rpath.py index 5ab2182a7..6e4172597 100755 --- a/src/build/remove_absolute_rpath.py +++ b/src/build/remove_absolute_rpath.py @@ -109,11 +109,14 @@ def fix_rpath(target, root): logging.info(f"Skipping {file} because numpy") return + # Prevent delete the same rpath multiple time (e.g. MacOS fat binary). + deletedRPATH = [] for rpath in get_rpaths(file): output = f"\trpath: {rpath}" - if rpath.startswith("@") is False and rpath.startswith(".") is False: + if rpath.startswith("@") is False and rpath.startswith(".") is False and not rpath in deletedRPATH: delete_rpath(file, rpath) + deletedRPATH.append(rpath) output += " (Deleted)" logging.info(output)