Skip to content

Commit

Permalink
Don't make unactionable warnings fatal
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nirbheek authored and jpakkane committed Jul 5, 2020
1 parent 99e9613 commit 40319c9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions mesonbuild/coredata.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,8 @@ def process_new_compiler(self, lang: str, comp: T.Type['Compiler'], env: 'Enviro

def emit_base_options_warnings(self, enabled_opts: list):
if 'b_bitcode' in enabled_opts:
mlog.warning('Base option \'b_bitcode\' is enabled, which is incompatible with many linker options. Incompatible options such as \'b_asneeded\' have been disabled.')
mlog.warning('Please see https://mesonbuild.com/Builtin-options.html#Notes_about_Apple_Bitcode_support for more details.')
mlog.warning('Base option \'b_bitcode\' is enabled, which is incompatible with many linker options. Incompatible options such as \'b_asneeded\' have been disabled.', fatal=False)
mlog.warning('Please see https://mesonbuild.com/Builtin-options.html#Notes_about_Apple_Bitcode_support for more details.', fatal=False)

class CmdLineFileParser(configparser.ConfigParser):
def __init__(self):
Expand Down
4 changes: 2 additions & 2 deletions mesonbuild/mlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/modules/qt4.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ def __init__(self, interpreter):

def initialize(*args, **kwargs):
mlog.warning('rcc dependencies will not work properly until this upstream issue is fixed:',
mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460'))
mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460'), fatal=False)
return Qt4Module(*args, **kwargs)
2 changes: 1 addition & 1 deletion mesonbuild/modules/qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ def __init__(self, interpreter):

def initialize(*args, **kwargs):
mlog.warning('rcc dependencies will not work reliably until this upstream issue is fixed:',
mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460'))
mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460'), fatal=False)
return Qt5Module(*args, **kwargs)
2 changes: 1 addition & 1 deletion mesonbuild/modules/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def compile_resources(self, state, args, kwargs):
'a MinGW bug: https://sourceware.org/bugzilla/show_bug.cgi?id=4933'
for arg in extra_args:
if ' ' in arg:
mlog.warning(m.format(arg))
mlog.warning(m.format(arg), fatal=False)

res_targets = []

Expand Down

0 comments on commit 40319c9

Please sign in to comment.