diff options
| author | Tobias Diez <code@tobiasdiez.com> | 2025-07-21 10:31:08 +0200 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2025-08-26 01:46:28 -0400 |
| commit | d1090edb914be0efaddabd5a254bb2051d74bb59 (patch) | |
| tree | d25279b656cca3d7654ccffed7b6657f6dc14c92 /mesonbuild/scripts/externalproject.py | |
| parent | b5bd201420d48d7a030b78f8dfc23161cb058841 (diff) | |
| download | meson-d1090edb914be0efaddabd5a254bb2051d74bb59.tar.gz | |
Print external project logfile on CI systems
Diffstat (limited to 'mesonbuild/scripts/externalproject.py')
| -rw-r--r-- | mesonbuild/scripts/externalproject.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/scripts/externalproject.py b/mesonbuild/scripts/externalproject.py index 4013b0acf..b782a8551 100644 --- a/mesonbuild/scripts/externalproject.py +++ b/mesonbuild/scripts/externalproject.py @@ -10,6 +10,7 @@ from pathlib import Path import typing as T from ..mesonlib import Popen_safe, split_args, determine_worker_count +from .. import mlog class ExternalProject: def __init__(self, options: argparse.Namespace): @@ -67,10 +68,10 @@ class ExternalProject: def _run(self, step: str, command: T.List[str], env: T.Optional[T.Dict[str, str]] = None) -> int: m = 'Running command ' + str(command) + ' in directory ' + str(self.build_dir) + '\n' - log_filename = Path(self.log_dir, f'{self.name}-{step}.log') + logfile = Path(self.log_dir, f'{self.name}-{step}.log') output = None if not self.verbose: - output = open(log_filename, 'w', encoding='utf-8') + output = open(logfile, 'w', encoding='utf-8') output.write(m + '\n') output.flush() else: @@ -84,8 +85,11 @@ class ExternalProject: if p.returncode != 0: m = f'{step} step returned error code {p.returncode}.' if not self.verbose: - m += '\nSee logs: ' + str(log_filename) + m += '\nSee logs: ' + str(logfile) print(m) + contents = mlog.ci_fold_file(logfile, f'CI platform detected, click here for {os.path.basename(logfile)} contents.') + if contents: + print(contents) return p.returncode def run(args: T.List[str]) -> int: |
