From 40319c963447f7632753e694f606dc6d41a9f168 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 1 Jul 2020 06:52:56 +0530 Subject: Don't make unactionable warnings fatal Some warnings are out of the user's control, such as the RCC QT bug, or the GNU windres bug, or our informational warning about auto-disabling of options when -Db_bitcode is enabled. Such warnings should not be fatal when --fatal-meson-warnings is passed because there's no action that the user can take to fix it. The only purpose it serves is to prevent people who use those features from using --fatal-meson-warnings. --- mesonbuild/mlog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/mlog.py') diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index 7b8aec7..1e5a105 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -250,7 +250,7 @@ def get_error_location_string(fname: str, lineno: str) -> str: return '{}:{}:'.format(fname, lineno) def _log_error(severity: str, *rargs: T.Union[str, AnsiDecorator], - once: bool = False, **kwargs: T.Any) -> None: + once: bool = False, fatal: bool = True, **kwargs: T.Any) -> None: from .mesonlib import MesonException, relpath # The typing requirements here are non-obvious. Lists are invariant, @@ -283,7 +283,7 @@ def _log_error(severity: str, *rargs: T.Union[str, AnsiDecorator], global log_warnings_counter log_warnings_counter += 1 - if log_fatal_warnings: + if log_fatal_warnings and fatal: raise MesonException("Fatal warnings enabled, aborting") def error(*args: T.Union[str, AnsiDecorator], **kwargs: T.Any) -> None: -- cgit v1.1