aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mlog.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-07-06 23:47:15 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-07-07 04:33:24 -0700
commit2093d45a4e1203d868d200628918472877c7ec31 (patch)
treea7253981585f71f5bd3a0053deff8ed90ad690ee /mesonbuild/mlog.py
parent80392225a61a5baa28ef1f45bfc19b4623d2d188 (diff)
downloadmeson-2093d45a4e1203d868d200628918472877c7ec31.zip
meson-2093d45a4e1203d868d200628918472877c7ec31.tar.gz
meson-2093d45a4e1203d868d200628918472877c7ec31.tar.bz2
Print a more usable message when a subproject fails to configure
Instead of just printing the message in the exception, if it's a MesonException, also print the file and the line number. If it's an unknown exception, print the entire traceback so that we can pin-point what the Meson bug causing it is.
Diffstat (limited to 'mesonbuild/mlog.py')
-rw-r--r--mesonbuild/mlog.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py
index b75a267..1654824 100644
--- a/mesonbuild/mlog.py
+++ b/mesonbuild/mlog.py
@@ -140,7 +140,8 @@ def log(*args, **kwargs):
force_print(*arr, **kwargs)
def _log_error(severity, *args, **kwargs):
- from . import environment
+ from .mesonlib import get_error_location_string
+ from .environment import build_filename
if severity == 'warning':
args = (yellow('WARNING:'),) + args
elif severity == 'error':
@@ -152,9 +153,8 @@ def _log_error(severity, *args, **kwargs):
location = kwargs.pop('location', None)
if location is not None:
- location_str = '{}:{}:'.format(os.path.join(location.subdir,
- environment.build_filename),
- location.lineno)
+ location_file = os.path.join(location.subdir, build_filename)
+ location_str = get_error_location_string(location_file, location.lineno)
args = (location_str,) + args
log(*args, **kwargs)