From 19847ba24a5a6e7c33c4e00a49842d77f7c5a4a3 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 29 Aug 2024 18:46:44 -0400 Subject: [PATCH] update various deprecation notices to call out meson 2.0 --- mesonbuild/build.py | 2 +- mesonbuild/environment.py | 2 +- mesonbuild/interpreter/interpreter.py | 6 +++--- mesonbuild/interpreter/interpreterobjects.py | 2 +- mesonbuild/modules/pkgconfig.py | 2 +- mesonbuild/mparser.py | 2 +- mesonbuild/options.py | 4 ++-- unittests/allplatformstests.py | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mesonbuild/build.py b/mesonbuild/build.py index b9cc42721..a7a43b40c 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1702,7 +1702,7 @@ class BuildTarget(Target): else: mlog.deprecation(f'target {self.name} links against shared module {link_target.name}, which is incorrect.' '\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 ' f'If shared_module() was used for {link_target.name} because it has references to undefined symbols,' '\n ' diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index c26516215..5f4de73d5 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -694,7 +694,7 @@ class Environment: 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 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: 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 diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 7bcbf8c6d..9de0f8762 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -256,7 +256,7 @@ permitted_dependency_kwargs = { implicit_check_false_warning = """You should add the boolean check kwarg to the run_command call. 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""" class Interpreter(InterpreterBase, HoldableObject): @@ -2300,7 +2300,7 @@ class Interpreter(InterpreterBase, HoldableObject): if kwargs['install_dir'] is not None: raise InterpreterException('install_headers: cannot specify both "install_dir" and "subdir". Use only "install_dir".') 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: install_subdir = '' @@ -3157,7 +3157,7 @@ class Interpreter(InterpreterBase, HoldableObject): if not strict and s.startswith(self.environment.get_build_dir()): results.append(s) 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: self.validate_within_subproject(self.subdir, s) results.append(mesonlib.File.from_source_file(self.environment.source_dir, self.subdir, s)) diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py index bbc5b8608..155cfd23e 100644 --- a/mesonbuild/interpreter/interpreterobjects.py +++ b/mesonbuild/interpreter/interpreterobjects.py @@ -938,7 +938,7 @@ class BuildTargetHolder(ObjectHolder[_BuildTarget]): extract_all_objects called without setting recursive keyword argument. Meson currently defaults to non-recursive to maintain backward compatibility but - the default will be changed in the future. + the default will be changed in meson 2.0. ''') ) ) diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 16c8c0798..61de8fc43 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -127,7 +127,7 @@ class DependenciesHelper: 'to generate() method instead of first positional ' 'argument.', 'Adding', mlog.bold(data.display_name), '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 ' 'warning cannot be avoided in your case.', location=data.location) diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py index fc37d2a54..79ece3789 100644 --- a/mesonbuild/mparser.py +++ b/mesonbuild/mparser.py @@ -362,7 +362,7 @@ class ArgumentNode(BaseNode): def set_kwarg(self, name: IdNode, value: BaseNode) -> None: 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('This will be an error in future Meson releases.') + mlog.warning('This will be an error in Meson 2.0.') self.kwargs[name] = value def set_kwarg_no_check(self, name: BaseNode, value: BaseNode) -> None: diff --git a/mesonbuild/options.py b/mesonbuild/options.py index 912cfa23b..d3d0c6789 100644 --- a/mesonbuild/options.py +++ b/mesonbuild/options.py @@ -409,7 +409,7 @@ class UserArrayOption(UserOption[T.List[str]]): if not self.allow_dups and len(set(newvalue)) != len(newvalue): 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) for i in newvalue: if not isinstance(i, str): @@ -500,7 +500,7 @@ class UserStdOption(UserComboOption): mlog.deprecation( 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' + - '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' + '"c_std=gnu11,c11" specifies that GNU is preferred but it can safely fallback to plain c11.') return newstd diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index dac7f9797..ccd2c476a 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -2464,7 +2464,7 @@ class AllPlatformTests(BasePlatformTests): tdir = os.path.join(self.unit_test_dir, '30 shared_mod linking') out = self.init(tdir) 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, use shared_library() with `override_options: ['b_lundef=false']` instead.''') self.assertIn(msg, out)