diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-11-03 17:05:28 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-11-03 17:51:35 -0400 |
commit | 97ec20e90142c229f62a6d20371f44df0b8dd41e (patch) | |
tree | 88785a1c4521ea780fbc90526a4cab2d640c41ea /mesonbuild/scripts/depfixer.py | |
parent | af41eb6e9b98a0611f870b9c01707f3428ee3704 (diff) | |
download | meson-97ec20e90142c229f62a6d20371f44df0b8dd41e.zip meson-97ec20e90142c229f62a6d20371f44df0b8dd41e.tar.gz meson-97ec20e90142c229f62a6d20371f44df0b8dd41e.tar.bz2 |
depfixer: handle darwin dependencies with non-ASCII paths
I assume there's no real reason this cannot happen, perhaps if the meson
source directory has one. So we should use Popen_safe for safety
reasons.
Diffstat (limited to 'mesonbuild/scripts/depfixer.py')
-rw-r--r-- | mesonbuild/scripts/depfixer.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py index e0090ac..31e3f0d 100644 --- a/mesonbuild/scripts/depfixer.py +++ b/mesonbuild/scripts/depfixer.py @@ -21,7 +21,7 @@ import shutil import subprocess import typing as T -from ..mesonlib import OrderedSet, generate_list +from ..mesonlib import OrderedSet, generate_list, Popen_safe SHT_STRTAB = 3 DT_NEEDED = 1 @@ -391,9 +391,9 @@ def fix_elf(fname: str, rpath_dirs_to_remove: T.Set[bytes], new_rpath: T.Optiona e.fix_rpath(fname, rpath_dirs_to_remove, new_rpath) def get_darwin_rpaths_to_remove(fname: str) -> T.List[str]: - out = subprocess.check_output(['otool', '-l', fname], - universal_newlines=True, - stderr=subprocess.DEVNULL) + p, out, _ = Popen_safe(['otool', '-l', fname], stderr=subprocess.DEVNULL) + if p.returncode != 0: + raise subprocess.CalledProcessError(p.returncode, p.args, out) result = [] current_cmd = 'FOOBAR' for line in out.split('\n'): |