summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2025-01-27 11:20:54 -0500
committerEli Schwartz <eschwartz93@gmail.com>2025-01-28 11:32:55 -0500
commit8a9dea2e3745935d55201123288e529acede043e (patch)
tree12c19fcb7bf06be381f51dbba447278c3305a515
parentd51e20288853f376e9244671604176913f2e4e79 (diff)
downloadmeson-8a9dea2e3745935d55201123288e529acede043e.tar.gz
When subproject() fails because downloading is disabled, say what failed
It's not especially explanatory to say: ``` meson.build:357:34: ERROR: Automatic wrap-based subproject downloading is disabled ``` But if we instead say this: ``` ERROR: Subproject libsamplerate is buildable: NO meson.build:357:34: ERROR: Automatic wrap-based subproject downloading is disabled ``` It becomes a lot clearer to casual inspection, why it failed. And it matches the way we otherwise report errors for an unbuildable subproject (configure errors). Bug: https://github.com/jacktrip/jacktrip/issues/1380
-rw-r--r--mesonbuild/interpreter/interpreter.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index c7aef9329..d05594cbd 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -916,10 +916,16 @@ class Interpreter(InterpreterBase, HoldableObject):
try:
subdir, method = r.resolve(subp_name, force_method)
except wrap.WrapException as e:
+ if force_method is not None:
+ prefix = force_method.title() + ' subproject'
+ else:
+ prefix = 'Subproject'
+ msg = [prefix, mlog.bold(subp_name), 'is buildable:', mlog.red('NO')]
if not required:
mlog.log(e)
- mlog.log('Subproject ', mlog.bold(subp_name), 'is buildable:', mlog.red('NO'), '(disabling)')
+ mlog.log(*msg, '(disabling)')
return self.disabled_subproject(subp_name, exception=e)
+ mlog.error(*msg)
raise e
os.makedirs(os.path.join(self.build.environment.get_build_dir(), subdir), exist_ok=True)