diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-05-23 19:32:40 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-09-20 12:57:50 +0100 |
commit | 194dcdef03e4c562c458fddc64b9162100fc036c (patch) | |
tree | 3882a71a71d494eec050076d4d8042464356fc09 /mesonbuild | |
parent | c72625c2a74b198721c6e1f0cb0b653a4cd9addc (diff) | |
download | meson-194dcdef03e4c562c458fddc64b9162100fc036c.zip meson-194dcdef03e4c562c458fddc64b9162100fc036c.tar.gz meson-194dcdef03e4c562c458fddc64b9162100fc036c.tar.bz2 |
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.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/backend/backends.py | 1 | ||||
-rw-r--r-- | mesonbuild/scripts/meson_exe.py | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 156f3bd..35e4751 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -114,6 +114,7 @@ class ExecutableSerialisation: self.workdir = workdir self.extra_paths = extra_paths self.capture = capture + self.pickled = False class TestSerialisation: def __init__(self, name: str, project: str, suite: str, fname: T.List[str], diff --git a/mesonbuild/scripts/meson_exe.py b/mesonbuild/scripts/meson_exe.py index df54b47..50ad2f5 100644 --- a/mesonbuild/scripts/meson_exe.py +++ b/mesonbuild/scripts/meson_exe.py @@ -55,9 +55,12 @@ def run_exe(exe: ExecutableSerialisation) -> int: stderr=subprocess.PIPE) stdout, stderr = p.communicate() + if exe.pickled and p.returncode != 0: + print('while executing {!r}'.format(cmd_args)) + if p.returncode == 0xc0000135: # 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: skip_write = False @@ -90,6 +93,7 @@ def run(args: T.List[str]) -> int: parser.error('no other arguments can be used with --unpickle') with open(options.unpickle, 'rb') as f: exe = pickle.load(f) + exe.pickled = True else: exe = ExecutableSerialisation(cmd_args, capture=options.capture) |