diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-02-14 02:58:37 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-02-28 11:54:04 +0000 |
commit | 346b5c4be71bb1f502507d92ffdb1ded4c3bd85d (patch) | |
tree | e2cfb85a848d6418c07418af9982f6cd4ac532d8 /mesonbuild/mlog.py | |
parent | 534a974da756c4b71b7ba10a6853c2be14a9b30e (diff) | |
download | meson-346b5c4be71bb1f502507d92ffdb1ded4c3bd85d.zip meson-346b5c4be71bb1f502507d92ffdb1ded4c3bd85d.tar.gz meson-346b5c4be71bb1f502507d92ffdb1ded4c3bd85d.tar.bz2 |
Store filename in node location
Warnings have a location node object (with subdir and lineno
attributes), which is passed as a location: kwarg to mlog.warning() and
formatted in _log_error().
Re-purpose the subdir attribute (path relative to the source root dir,
with an implied filename of 'meson.build'), which is stored into the
node by parser(), to contain a pathname.
(Properly I should rename 'subdir' -> 'file' everywhere, but that's a
lot of churn just to see if this works)
Notes:
The warning location node may also have a colno attribute, which is
currently ignored by _log_error().
We can't currently issue warnings with locations in meson_options.txt
because the filename isn't part of the location (as it's assumed to be
'meson.build).
Diffstat (limited to 'mesonbuild/mlog.py')
-rw-r--r-- | mesonbuild/mlog.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index c5ebbbf..b563e41 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -251,7 +251,7 @@ def _log_error(severity: str, *rargs: T.Union[str, AnsiDecorator], location = kwargs.pop('location', None) if location is not None: - location_file = os.path.join(location.subdir, build_filename) + location_file = location.subdir location_str = get_error_location_string(location_file, location.lineno) # Unions are frankly awful, and we have to T.cast here to get mypy # to understand that the list concatenation is safe |