aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-03-23 17:28:26 +0200
committerGitHub <noreply@github.com>2021-03-23 17:28:26 +0200
commitde9df5128c03d016ec9463f705422f2e1df4c49a (patch)
tree143434ec0a4efb3b0219e33940798d6d9963696c /mesonbuild/interpreter.py
parent9ab4dadef99cacb6a556154b7f520afba0877dc4 (diff)
parent8cd4d0b2832666f19660b9006040e5ff7e5d4576 (diff)
downloadmeson-de9df5128c03d016ec9463f705422f2e1df4c49a.zip
meson-de9df5128c03d016ec9463f705422f2e1df4c49a.tar.gz
meson-de9df5128c03d016ec9463f705422f2e1df4c49a.tar.bz2
Merge pull request #7491 from xclaesse/callstack
RFC: logs: Prepend current subproject name to all messages
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 812f7bd..cbb2324 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2911,9 +2911,12 @@ external dependencies (including libraries) must go to "dependencies".''')
os.makedirs(os.path.join(self.build.environment.get_build_dir(), subdir), exist_ok=True)
self.global_args_frozen = True
- mlog.log()
- with mlog.nested():
- mlog.log('Executing subproject', mlog.bold(subp_name), 'method', mlog.bold(method), '\n')
+ stack = ':'.join(self.subproject_stack + [subp_name])
+ m = ['\nExecuting subproject', mlog.bold(stack)]
+ if method != 'meson':
+ m += ['method', mlog.bold(method)]
+ mlog.log(*m,'\n', nested=False)
+
try:
if method == 'meson':
return self._do_subproject_meson(subp_name, subdir, default_options, kwargs)
@@ -2926,7 +2929,7 @@ external dependencies (including libraries) must go to "dependencies".''')
raise
except Exception as e:
if not required:
- with mlog.nested():
+ with mlog.nested(subp_name):
# Suppress the 'ERROR:' prefix because this exception is not
# fatal and VS CI treat any logs with "ERROR:" as fatal.
mlog.exception(e, prefix=mlog.yellow('Exception:'))
@@ -2938,7 +2941,7 @@ external dependencies (including libraries) must go to "dependencies".''')
ast: T.Optional[mparser.CodeBlockNode] = None,
build_def_files: T.Optional[T.List[str]] = None,
is_translated: bool = False) -> SubprojectHolder:
- with mlog.nested():
+ with mlog.nested(subp_name):
new_build = self.build.copy()
subi = Interpreter(new_build, self.backend, subp_name, subdir, self.subproject_dir,
self.modules, default_options, ast=ast, is_translated=is_translated)
@@ -2975,7 +2978,7 @@ external dependencies (including libraries) must go to "dependencies".''')
return self.subprojects[subp_name]
def _do_subproject_cmake(self, subp_name, subdir, subdir_abs, default_options, kwargs):
- with mlog.nested():
+ with mlog.nested(subp_name):
new_build = self.build.copy()
prefix = self.coredata.options[OptionKey('prefix')].value
@@ -2995,7 +2998,7 @@ external dependencies (including libraries) must go to "dependencies".''')
ast = cm_int.pretend_to_be_meson(options.target_options)
mlog.log()
- with mlog.nested():
+ with mlog.nested('cmake-ast'):
mlog.log('Processing generated meson AST')
# Debug print the generated meson file