Make meson_exe report pickled command when it fails
Make 'meson --internal exe --unpickle' report the actual command executed when it fails, which is otherwise invisible.
This commit is contained in:
parent
c72625c2a7
commit
194dcdef03
|
@ -114,6 +114,7 @@ class ExecutableSerialisation:
|
||||||
self.workdir = workdir
|
self.workdir = workdir
|
||||||
self.extra_paths = extra_paths
|
self.extra_paths = extra_paths
|
||||||
self.capture = capture
|
self.capture = capture
|
||||||
|
self.pickled = False
|
||||||
|
|
||||||
class TestSerialisation:
|
class TestSerialisation:
|
||||||
def __init__(self, name: str, project: str, suite: str, fname: T.List[str],
|
def __init__(self, name: str, project: str, suite: str, fname: T.List[str],
|
||||||
|
|
|
@ -55,9 +55,12 @@ def run_exe(exe: ExecutableSerialisation) -> int:
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
|
|
||||||
|
if exe.pickled and p.returncode != 0:
|
||||||
|
print('while executing {!r}'.format(cmd_args))
|
||||||
|
|
||||||
if p.returncode == 0xc0000135:
|
if p.returncode == 0xc0000135:
|
||||||
# STATUS_DLL_NOT_FOUND on Windows indicating a common problem that is otherwise hard to diagnose
|
# STATUS_DLL_NOT_FOUND on Windows indicating a common problem that is otherwise hard to diagnose
|
||||||
raise FileNotFoundError('Missing DLLs on calling {!r}'.format(cmd_args))
|
raise FileNotFoundError('due to missing DLLs')
|
||||||
|
|
||||||
if exe.capture and p.returncode == 0:
|
if exe.capture and p.returncode == 0:
|
||||||
skip_write = False
|
skip_write = False
|
||||||
|
@ -90,6 +93,7 @@ def run(args: T.List[str]) -> int:
|
||||||
parser.error('no other arguments can be used with --unpickle')
|
parser.error('no other arguments can be used with --unpickle')
|
||||||
with open(options.unpickle, 'rb') as f:
|
with open(options.unpickle, 'rb') as f:
|
||||||
exe = pickle.load(f)
|
exe = pickle.load(f)
|
||||||
|
exe.pickled = True
|
||||||
else:
|
else:
|
||||||
exe = ExecutableSerialisation(cmd_args, capture=options.capture)
|
exe = ExecutableSerialisation(cmd_args, capture=options.capture)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue