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.
pull/10986/head
Eli Schwartz 2 years ago
parent af41eb6e9b
commit 97ec20e901
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 8
      mesonbuild/scripts/depfixer.py

@ -21,7 +21,7 @@ import shutil
import subprocess import subprocess
import typing as T import typing as T
from ..mesonlib import OrderedSet, generate_list from ..mesonlib import OrderedSet, generate_list, Popen_safe
SHT_STRTAB = 3 SHT_STRTAB = 3
DT_NEEDED = 1 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) e.fix_rpath(fname, rpath_dirs_to_remove, new_rpath)
def get_darwin_rpaths_to_remove(fname: str) -> T.List[str]: def get_darwin_rpaths_to_remove(fname: str) -> T.List[str]:
out = subprocess.check_output(['otool', '-l', fname], p, out, _ = Popen_safe(['otool', '-l', fname], stderr=subprocess.DEVNULL)
universal_newlines=True, if p.returncode != 0:
stderr=subprocess.DEVNULL) raise subprocess.CalledProcessError(p.returncode, p.args, out)
result = [] result = []
current_cmd = 'FOOBAR' current_cmd = 'FOOBAR'
for line in out.split('\n'): for line in out.split('\n'):

Loading…
Cancel
Save