diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-09-29 19:28:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-29 19:28:51 +0300 |
commit | 400ec2d6857ba72147a3d9389777ec64e12fe67e (patch) | |
tree | 933d2de6c8759f755669e65a6a93c61f712cf399 /mesonbuild/backend/backends.py | |
parent | d1638a4fde5be879fe7778200b6ae6d59106a25e (diff) | |
parent | bd16b4846f3d49725cee5b750162270d1de79388 (diff) | |
download | meson-400ec2d6857ba72147a3d9389777ec64e12fe67e.zip meson-400ec2d6857ba72147a3d9389777ec64e12fe67e.tar.gz meson-400ec2d6857ba72147a3d9389777ec64e12fe67e.tar.bz2 |
Merge pull request #7762 from jon-turney/meson-exe-output-improve
Improve the output for meson wrapped commands
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index a8b6df9..65a8932 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], @@ -395,13 +396,30 @@ class Backend: exe_cmd = ['mono'] + exe_cmd exe_wrapper = None - force_serialize = force_serialize or extra_paths or workdir or \ - exe_wrapper or any('\n' in c for c in cmd_args) + reasons = [] + if extra_paths: + reasons.append('to set PATH') + + if exe_wrapper: + reasons.append('to use exe_wrapper') + + if workdir: + reasons.append('to set workdir') + + if any('\n' in c for c in cmd_args): + reasons.append('because command contains newlines') + + force_serialize = force_serialize or bool(reasons) + + if capture: + reasons.append('to capture output') + if not force_serialize: if not capture: - return None - return (self.environment.get_build_command() + - ['--internal', 'exe', '--capture', capture, '--'] + exe_cmd + cmd_args) + return None, '' + return ((self.environment.get_build_command() + + ['--internal', 'exe', '--capture', capture, '--'] + exe_cmd + cmd_args), + ', '.join(reasons)) workdir = workdir or self.environment.get_build_dir() env = {} @@ -425,7 +443,8 @@ class Backend: exe_wrapper, workdir, extra_paths, capture) pickle.dump(es, f) - return self.environment.get_build_command() + ['--internal', 'exe', '--unpickle', exe_data] + return (self.environment.get_build_command() + ['--internal', 'exe', '--unpickle', exe_data], + ', '.join(reasons)) def serialize_tests(self): test_data = os.path.join(self.environment.get_scratch_dir(), 'meson_test_setup.dat') |