update various deprecation notices to call out meson 2.0

pull/13617/head
Eli Schwartz 3 months ago
parent 29797f92f8
commit 19847ba24a
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      mesonbuild/build.py
  2. 2
      mesonbuild/environment.py
  3. 6
      mesonbuild/interpreter/interpreter.py
  4. 2
      mesonbuild/interpreter/interpreterobjects.py
  5. 2
      mesonbuild/modules/pkgconfig.py
  6. 2
      mesonbuild/mparser.py
  7. 4
      mesonbuild/options.py
  8. 2
      unittests/allplatformstests.py

@ -1702,7 +1702,7 @@ class BuildTarget(Target):
else: else:
mlog.deprecation(f'target {self.name} links against shared module {link_target.name}, which is incorrect.' mlog.deprecation(f'target {self.name} links against shared module {link_target.name}, which is incorrect.'
'\n ' '\n '
f'This will be an error in the future, so please use shared_library() for {link_target.name} instead.' f'This will be an error in meson 2.0, so please use shared_library() for {link_target.name} instead.'
'\n ' '\n '
f'If shared_module() was used for {link_target.name} because it has references to undefined symbols,' f'If shared_module() was used for {link_target.name} because it has references to undefined symbols,'
'\n ' '\n '

@ -694,7 +694,7 @@ class Environment:
key = OptionKey.from_string(k) key = OptionKey.from_string(k)
# If we're in the cross file, and there is a `build.foo` warn about that. Later we'll remove it. # If we're in the cross file, and there is a `build.foo` warn about that. Later we'll remove it.
if machine is MachineChoice.HOST and key.machine is not machine: if machine is MachineChoice.HOST and key.machine is not machine:
mlog.deprecation('Setting build machine options in cross files, please use a native file instead, this will be removed in meson 0.60', once=True) mlog.deprecation('Setting build machine options in cross files, please use a native file instead, this will be removed in meson 2.0', once=True)
if key.subproject: if key.subproject:
raise MesonException('Do not set subproject options in [built-in options] section, use [subproject:built-in options] instead.') raise MesonException('Do not set subproject options in [built-in options] section, use [subproject:built-in options] instead.')
self.options[key.evolve(subproject=subproject, machine=machine)] = v self.options[key.evolve(subproject=subproject, machine=machine)] = v

@ -256,7 +256,7 @@ permitted_dependency_kwargs = {
implicit_check_false_warning = """You should add the boolean check kwarg to the run_command call. implicit_check_false_warning = """You should add the boolean check kwarg to the run_command call.
It currently defaults to false, It currently defaults to false,
but it will default to true in future releases of meson. but it will default to true in meson 2.0.
See also: https://github.com/mesonbuild/meson/issues/9300""" See also: https://github.com/mesonbuild/meson/issues/9300"""
class Interpreter(InterpreterBase, HoldableObject): class Interpreter(InterpreterBase, HoldableObject):
@ -2300,7 +2300,7 @@ class Interpreter(InterpreterBase, HoldableObject):
if kwargs['install_dir'] is not None: if kwargs['install_dir'] is not None:
raise InterpreterException('install_headers: cannot specify both "install_dir" and "subdir". Use only "install_dir".') raise InterpreterException('install_headers: cannot specify both "install_dir" and "subdir". Use only "install_dir".')
if os.path.isabs(install_subdir): if os.path.isabs(install_subdir):
mlog.deprecation('Subdir keyword must not be an absolute path. This will be a hard error in the next release.') mlog.deprecation('Subdir keyword must not be an absolute path. This will be a hard error in meson 2.0.')
else: else:
install_subdir = '' install_subdir = ''
@ -3157,7 +3157,7 @@ class Interpreter(InterpreterBase, HoldableObject):
if not strict and s.startswith(self.environment.get_build_dir()): if not strict and s.startswith(self.environment.get_build_dir()):
results.append(s) results.append(s)
mlog.warning(f'Source item {s!r} cannot be converted to File object, because it is a generated file. ' mlog.warning(f'Source item {s!r} cannot be converted to File object, because it is a generated file. '
'This will become a hard error in the future.', location=self.current_node) 'This will become a hard error in meson 2.0.', location=self.current_node)
else: else:
self.validate_within_subproject(self.subdir, s) self.validate_within_subproject(self.subdir, s)
results.append(mesonlib.File.from_source_file(self.environment.source_dir, self.subdir, s)) results.append(mesonlib.File.from_source_file(self.environment.source_dir, self.subdir, s))

@ -938,7 +938,7 @@ class BuildTargetHolder(ObjectHolder[_BuildTarget]):
extract_all_objects called without setting recursive extract_all_objects called without setting recursive
keyword argument. Meson currently defaults to keyword argument. Meson currently defaults to
non-recursive to maintain backward compatibility but non-recursive to maintain backward compatibility but
the default will be changed in the future. the default will be changed in meson 2.0.
''') ''')
) )
) )

@ -127,7 +127,7 @@ class DependenciesHelper:
'to generate() method instead of first positional ' 'to generate() method instead of first positional '
'argument.', 'Adding', mlog.bold(data.display_name), 'argument.', 'Adding', mlog.bold(data.display_name),
'to "Requires" field, but this is a deprecated ' 'to "Requires" field, but this is a deprecated '
'behaviour that will change in a future version ' 'behaviour that will change in version 2.0 '
'of Meson. Please report the issue if this ' 'of Meson. Please report the issue if this '
'warning cannot be avoided in your case.', 'warning cannot be avoided in your case.',
location=data.location) location=data.location)

@ -362,7 +362,7 @@ class ArgumentNode(BaseNode):
def set_kwarg(self, name: IdNode, value: BaseNode) -> None: def set_kwarg(self, name: IdNode, value: BaseNode) -> None:
if any((isinstance(x, IdNode) and name.value == x.value) for x in self.kwargs): if any((isinstance(x, IdNode) and name.value == x.value) for x in self.kwargs):
mlog.warning(f'Keyword argument "{name.value}" defined multiple times.', location=self) mlog.warning(f'Keyword argument "{name.value}" defined multiple times.', location=self)
mlog.warning('This will be an error in future Meson releases.') mlog.warning('This will be an error in Meson 2.0.')
self.kwargs[name] = value self.kwargs[name] = value
def set_kwarg_no_check(self, name: BaseNode, value: BaseNode) -> None: def set_kwarg_no_check(self, name: BaseNode, value: BaseNode) -> None:

@ -409,7 +409,7 @@ class UserArrayOption(UserOption[T.List[str]]):
if not self.allow_dups and len(set(newvalue)) != len(newvalue): if not self.allow_dups and len(set(newvalue)) != len(newvalue):
msg = 'Duplicated values in array option is deprecated. ' \ msg = 'Duplicated values in array option is deprecated. ' \
'This will become a hard error in the future.' 'This will become a hard error in meson 2.0.'
mlog.deprecation(msg) mlog.deprecation(msg)
for i in newvalue: for i in newvalue:
if not isinstance(i, str): if not isinstance(i, str):
@ -500,7 +500,7 @@ class UserStdOption(UserComboOption):
mlog.deprecation( mlog.deprecation(
f'None of the values {candidates} are supported by the {self.lang} compiler.\n' + f'None of the values {candidates} are supported by the {self.lang} compiler.\n' +
f'However, the deprecated {std} std currently falls back to {newstd}.\n' + f'However, the deprecated {std} std currently falls back to {newstd}.\n' +
'This will be an error in the future.\n' + 'This will be an error in meson 2.0.\n' +
'If the project supports both GNU and MSVC compilers, a value such as\n' + 'If the project supports both GNU and MSVC compilers, a value such as\n' +
'"c_std=gnu11,c11" specifies that GNU is preferred but it can safely fallback to plain c11.') '"c_std=gnu11,c11" specifies that GNU is preferred but it can safely fallback to plain c11.')
return newstd return newstd

@ -2464,7 +2464,7 @@ class AllPlatformTests(BasePlatformTests):
tdir = os.path.join(self.unit_test_dir, '30 shared_mod linking') tdir = os.path.join(self.unit_test_dir, '30 shared_mod linking')
out = self.init(tdir) out = self.init(tdir)
msg = ('''DEPRECATION: target prog links against shared module mymod, which is incorrect. msg = ('''DEPRECATION: target prog links against shared module mymod, which is incorrect.
This will be an error in the future, so please use shared_library() for mymod instead. This will be an error in meson 2.0, so please use shared_library() for mymod instead.
If shared_module() was used for mymod because it has references to undefined symbols, If shared_module() was used for mymod because it has references to undefined symbols,
use shared_library() with `override_options: ['b_lundef=false']` instead.''') use shared_library() with `override_options: ['b_lundef=false']` instead.''')
self.assertIn(msg, out) self.assertIn(msg, out)

Loading…
Cancel
Save