Add fatal=False to many mlog.warnings()

There are lots of warnings that become fatal, that are simply unfixable
by the end user. Things like using old versions of software (because
they're using some kind of LTS release), warnings about compilers not
supporting certain kinds of checks, or standards being upgraded due to
skipped implementations (MSVC has c++98 and c++14, but not c++11). None
of these should be fatal, they're informative, and too important to
reduce to notices, but not important enough to stop meson if they're
printed.
pull/11179/head
Dylan Baker 2 years ago committed by Eli Schwartz
parent 0a873f6470
commit f7cde8d3f6
  1. 7
      mesonbuild/compilers/cpp.py
  2. 3
      mesonbuild/coredata.py
  3. 4
      mesonbuild/dependencies/dev.py
  4. 5
      mesonbuild/environment.py
  5. 8
      mesonbuild/modules/gnome.py

@ -59,7 +59,7 @@ def non_msvc_eh_options(eh: str, args: T.List[str]) -> None:
args.append('-fno-exceptions')
elif eh in {'s', 'c'}:
mlog.warning(f'non-MSVC compilers do not support {eh} exception handling. '
'You may want to set eh to \'default\'.')
'You may want to set eh to \'default\'.', fatal=False)
class CPPCompiler(CLikeCompiler, Compiler):
def attribute_check_func(self, name: str) -> str:
@ -692,7 +692,8 @@ class CPP11AsCPP14Mixin(CompilerMixinBase):
key = OptionKey('std', machine=self.for_machine, lang=self.language)
if options[key].value in {'vc++11', 'c++11'}:
mlog.warning(self.id, 'does not support C++11;',
'attempting best effort; setting the standard to C++14', once=True)
'attempting best effort; setting the standard to C++14',
once=True, fatal=False)
# Don't mutate anything we're going to change, we need to use
# deepcopy since we're messing with members, and we can't simply
# copy the members because the option proxy doesn't support it.
@ -732,7 +733,7 @@ class VisualStudioCPPCompiler(CPP11AsCPP14Mixin, VisualStudioLikeCPPCompilerMixi
def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]:
key = OptionKey('std', machine=self.for_machine, lang=self.language)
if options[key].value != 'none' and version_compare(self.version, '<19.00.24210'):
mlog.warning('This version of MSVC does not support cpp_std arguments')
mlog.warning('This version of MSVC does not support cpp_std arguments', fatal=False)
options = copy.copy(options)
options[key].value = 'none'

@ -782,7 +782,8 @@ class CoreData:
try:
value.set_value(oldval.value)
except MesonException:
mlog.warning(f'Old value(s) of {key} are no longer valid, resetting to default ({value.value}).')
mlog.warning(f'Old value(s) of {key} are no longer valid, resetting to default ({value.value}).',
fatal=False)
def is_cross_build(self, when_building_for: MachineChoice = MachineChoice.HOST) -> bool:
if when_building_for == MachineChoice.BUILD:

@ -422,7 +422,7 @@ class LLVMDependencyCMake(CMakeDependency):
# cmake if dynamic is required
if not self.static:
self.is_found = False
mlog.warning('Ignoring LLVM CMake dependency because dynamic was requested')
mlog.warning('Ignoring LLVM CMake dependency because dynamic was requested', fatal=False)
return
if self.traceparser is None:
@ -455,7 +455,7 @@ class LLVMDependencyCMake(CMakeDependency):
if required:
raise self._gen_exception(f'LLVM module {mod} was not found')
else:
mlog.warning('Optional LLVM module', mlog.bold(mod), 'was not found')
mlog.warning('Optional LLVM module', mlog.bold(mod), 'was not found', fatal=False)
continue
for i in cm_targets:
res += [(i, required)]

@ -455,7 +455,7 @@ class Environment:
# If we stored previous command line options, we can recover from
# a broken/outdated coredata.
if os.path.isfile(coredata.get_cmd_line_file(self.build_dir)):
mlog.warning('Regenerating configuration from scratch.')
mlog.warning('Regenerating configuration from scratch.', fatal=False)
mlog.log('Reason:', mlog.red(str(e)))
coredata.read_cmd_line_file(self.build_dir, options)
self.create_new_coredata(options)
@ -551,7 +551,8 @@ class Environment:
if bt in self.options and (db in self.options or op in self.options):
mlog.warning('Recommend using either -Dbuildtype or -Doptimization + -Ddebug. '
'Using both is redundant since they override each other. '
'See: https://mesonbuild.com/Builtin-options.html#build-type-options')
'See: https://mesonbuild.com/Builtin-options.html#build-type-options',
fatal=False)
exe_wrapper = self.lookup_binary_entry(MachineChoice.HOST, 'exe_wrapper')
if exe_wrapper is not None:

@ -319,14 +319,15 @@ class GnomeModule(ExtensionModule):
gresource_dep_needed_version):
mlog.warning('GLib compiled dependencies do not work reliably with \n'
'the current version of GLib. See the following upstream issue:',
mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=774368'))
mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=774368'),
fatal=False)
@staticmethod
def _print_gdbus_warning() -> None:
mlog.warning('Code generated with gdbus_codegen() requires the root directory be added to\n'
' include_directories of targets with GLib < 2.51.3:',
mlog.bold('https://github.com/mesonbuild/meson/issues/1387'),
once=True)
once=True, fatal=False)
@typed_kwargs(
'gnome.post_install',
@ -1966,7 +1967,8 @@ class GnomeModule(ExtensionModule):
else:
mlog.warning('The current version of GLib does not support extra arguments \n'
'for glib-genmarshal. You need at least GLib 2.53.3. See ',
mlog.bold('https://github.com/mesonbuild/meson/pull/2049'))
mlog.bold('https://github.com/mesonbuild/meson/pull/2049'),
fatal=False)
for k in ['internal', 'nostdinc', 'skip_source', 'stdinc', 'valist_marshallers']:
# Mypy can't figure out that this is correct
if kwargs[k]: # type: ignore

Loading…
Cancel
Save