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/modules | |
| parent | b5bd201420d48d7a030b78f8dfc23161cb058841 (diff) | |
| download | meson-d1090edb914be0efaddabd5a254bb2051d74bb59.tar.gz | |
Print external project logfile on CI systems
Diffstat (limited to 'mesonbuild/modules')
| -rw-r--r-- | mesonbuild/modules/external_project.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mesonbuild/modules/external_project.py b/mesonbuild/modules/external_project.py index 339d0003f..ba7b30075 100644 --- a/mesonbuild/modules/external_project.py +++ b/mesonbuild/modules/external_project.py @@ -201,10 +201,10 @@ class ExternalProject(NewExtensionModule): def _run(self, step: str, command: T.List[str], workdir: Path) -> None: mlog.log(f'External project {self.name}:', mlog.bold(step)) m = 'Running command ' + str(command) + ' in directory ' + str(workdir) + '\n' - log_filename = Path(mlog.get_log_dir(), f'{self.name}-{step}.log') + logfile = Path(mlog.get_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: @@ -215,7 +215,10 @@ class ExternalProject(NewExtensionModule): 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) + contents = mlog.ci_fold_file(logfile, f'CI platform detected, click here for {os.path.basename(logfile)} contents.') + if contents: + print(contents) raise MesonException(m) def _create_targets(self, extra_depends: T.List[T.Union['BuildTarget', 'CustomTarget']]) -> T.List['TYPE_var']: |
