From 56b1078bfd46c1ff8c456050c8198016009837a0 Mon Sep 17 00:00:00 2001 From: der richter Date: Thu, 22 Feb 2024 19:38:46 +0100 Subject: [PATCH] osxbundle: use dylib script directly instead of in a subprocess before errors and outputs where ignored from the subscript and the main script didn't fail nor did it output anything. with this change the script properly outputs everything to stdout and stderr. in the case the dylib script fails the whole script fails now. the main function in dylib_unhell was kept since it can still be used individually without the oscbundle script. the script had to be renamed with an underscore to make it importable. --- TOOLS/{dylib-unhell.py => dylib_unhell.py} | 6 +++--- TOOLS/osxbundle.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) rename TOOLS/{dylib-unhell.py => dylib_unhell.py} (99%) diff --git a/TOOLS/dylib-unhell.py b/TOOLS/dylib_unhell.py similarity index 99% rename from TOOLS/dylib-unhell.py rename to TOOLS/dylib_unhell.py index a029a03d9a..9cba3adb2f 100755 --- a/TOOLS/dylib-unhell.py +++ b/TOOLS/dylib_unhell.py @@ -236,8 +236,8 @@ def remove_dev_tools_rapths(binary): for path in get_rpaths_dev_tools(binary): install_name_tool_delete_rpath(path, binary) -def main(): - binary = os.path.abspath(sys.argv[1]) +def process(binary): + binary = os.path.abspath(binary) if not os.path.exists(lib_path(binary)): os.makedirs(lib_path(binary)) print(">> gathering all linked libraries") @@ -258,4 +258,4 @@ def main(): process_vulkan_loader(binary, "VkLayer_khronos_synchronization2.json", "vulkan/explicit_layer.d", "layer") if __name__ == "__main__": - main() + process(sys.argv[1]) diff --git a/TOOLS/osxbundle.py b/TOOLS/osxbundle.py index 1c769a06ab..1a9cfb4a6e 100755 --- a/TOOLS/osxbundle.py +++ b/TOOLS/osxbundle.py @@ -3,6 +3,7 @@ import os import shutil import sys import fileinput +import dylib_unhell from optparse import OptionParser def sh(command): @@ -77,7 +78,7 @@ def main(): if options.deps: print("> bundling dependencies") - print(sh(" ".join([os.path.join(src_path, "TOOLS/dylib-unhell.py"), target_binary(binary_name)]))) + dylib_unhell.process(target_binary(binary_name)) print("> signing bundle with ad-hoc pseudo identity") sign_bundle(binary_name)