aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-01-14 13:38:39 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2021-01-17 11:08:08 +0000
commit903c8716e373f829ef1d48712b26ad61d576436b (patch)
tree57ff0542e3a4f1cac14e9bff41400870b0b91516 /mesonbuild/modules
parentea2f34e2860680bab82aa7c2538971ab788209ce (diff)
downloadmeson-903c8716e373f829ef1d48712b26ad61d576436b.zip
meson-903c8716e373f829ef1d48712b26ad61d576436b.tar.gz
meson-903c8716e373f829ef1d48712b26ad61d576436b.tar.bz2
external_project: Write output in log files when not verbose
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/unstable_external_project.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/modules/unstable_external_project.py b/mesonbuild/modules/unstable_external_project.py
index 1604e25..e2205e5 100644
--- a/mesonbuild/modules/unstable_external_project.py
+++ b/mesonbuild/modules/unstable_external_project.py
@@ -162,12 +162,17 @@ class ExternalProject(InterpreterObject):
def _run(self, step: str, command: T.List[str]):
mlog.log('External project {}:'.format(self.name), mlog.bold(step))
- output = None if self.verbose else subprocess.DEVNULL
+ log_filename = Path(mlog.log_dir, '{}-{}.log'.format(self.name, step))
+ output = None
+ if not self.verbose:
+ output = open(log_filename, 'w')
p, o, e = Popen_safe(command, cwd=str(self.build_dir), env=self.run_env,
stderr=subprocess.STDOUT,
stdout=output)
if p.returncode != 0:
- m = '{} step failed:\n{}'.format(step, e)
+ m = '{} step returned error code {}.'.format(step, p.returncode)
+ if not self.verbose:
+ m += '\nSee logs: ' + str(log_filename)
raise MesonException(m)
def _create_targets(self):