From d7014d1cb27c432ed35290831f7fedd301bb481e Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 29 Apr 2018 20:45:46 +0300 Subject: [PATCH 09/16] Made depfixer more robust on OSX. Closes #3493. --- mesonbuild/scripts/depfixer.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py index 41ede1d5..185c76a4 100644 --- a/mesonbuild/scripts/depfixer.py +++ b/mesonbuild/scripts/depfixer.py @@ -347,7 +347,9 @@ def fix_elf(fname, new_rpath, verbose=True): e.fix_rpath(new_rpath) def get_darwin_rpaths_to_remove(fname): - out = subprocess.check_output(['otool', '-l', fname], universal_newlines=True) + out = subprocess.check_output(['otool', '-l', fname], + universal_newlines=True, + stderr=subprocess.DEVNULL) result = [] current_cmd = 'FOOBAR' for line in out.split('\n'): @@ -371,9 +373,13 @@ def fix_darwin(fname, new_rpath): return try: for rp in rpaths: - subprocess.check_call(['install_name_tool', '-delete_rpath', rp, fname]) - if new_rpath != '': - subprocess.check_call(['install_name_tool', '-add_rpath', new_rpath, fname]) + subprocess.check_call(['install_name_tool', '-delete_rpath', rp, fname], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + if new_rpath: + subprocess.check_call(['install_name_tool', '-add_rpath', new_rpath, fname], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) except Exception as e: raise sys.exit(0) -- 2.17.0