diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-01-13 21:34:41 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-01-17 22:12:43 +0200 |
commit | 59d043403956b6f3fa017c055a44e3e5d1f4c678 (patch) | |
tree | 415d82830c1480f7b200ae30bdc8075bc6b9c8ec | |
parent | b06b8c6452f68f4a1da0074d67b195801b23edee (diff) | |
download | meson-59d043403956b6f3fa017c055a44e3e5d1f4c678.zip meson-59d043403956b6f3fa017c055a44e3e5d1f4c678.tar.gz meson-59d043403956b6f3fa017c055a44e3e5d1f4c678.tar.bz2 |
Removed two deprecations from 2016.
5 files changed, 19 insertions, 17 deletions
diff --git a/docs/markdown/snippets/deprecations.md b/docs/markdown/snippets/deprecations.md new file mode 100644 index 0000000..adab2e6 --- /dev/null +++ b/docs/markdown/snippets/deprecations.md @@ -0,0 +1,14 @@ +## Removed two deprecated features + +The standalone `find_library` function has been a no-op for a long +time. Starting with this version it becomes a hard error. + +There used to be a keywordless version of `run_target` which looked +like this: + + run_target('targetname', 'command', 'arg1', 'arg2') + +This is now an error. The correct format for this is now: + + run_target('targetname', + command : ['command', 'arg1', 'arg2']) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index ed3a61e..b5ced9b 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1,4 +1,4 @@ -# Copyright 2012-2017 The Meson development team +# Copyright 2012-2018 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -36,8 +36,6 @@ from collections import namedtuple import importlib -run_depr_printed = False - def stringifyUserArguments(args): if isinstance(args, list): return '[%s]' % ', '.join([stringifyUserArguments(x) for x in args]) @@ -2138,7 +2136,7 @@ to directly access options of other subprojects.''') return progobj def func_find_library(self, node, args, kwargs): - mlog.log(mlog.red('DEPRECATION:'), 'find_library() is removed, use the corresponding method in compiler object instead.') + raise InvalidCode('find_library() is removed, use the corresponding method in a compiler object instead.') def _find_cached_dep(self, name, kwargs): # Check if we want this as a cross-dep or a native-dep @@ -2447,15 +2445,8 @@ root and issuing %s. @permittedKwargs(permitted_kwargs['run_target']) def func_run_target(self, node, args, kwargs): - global run_depr_printed if len(args) > 1: - if not run_depr_printed: - mlog.log(mlog.red('DEPRECATION'), 'positional version of run_target is deprecated, use the keyword version instead.') - run_depr_printed = True - if 'command' in kwargs: - raise InterpreterException('Can not have command both in positional and keyword arguments.') - all_args = args[1:] - deps = [] + raise InvalidCode('Run_target takes only one positional argument: the target name.') elif len(args) == 1: if 'command' not in kwargs: raise InterpreterException('Missing "command" keyword argument') diff --git a/test cases/common/58 run target/meson.build b/test cases/common/58 run target/meson.build index 686db1f..93a4ad0 100644 --- a/test cases/common/58 run target/meson.build +++ b/test cases/common/58 run target/meson.build @@ -1,8 +1,5 @@ project('run target', 'c') -# deprecated format, fix once we remove support for it. -run_target('mycommand','scripts/script.sh') - # Make it possible to run built programs. # In cross builds exe_wrapper should be added if it exists. diff --git a/test cases/common/90 identical target name in subproject/meson.build b/test cases/common/90 identical target name in subproject/meson.build index 98e4891..e804d3c 100644 --- a/test cases/common/90 identical target name in subproject/meson.build +++ b/test cases/common/90 identical target name in subproject/meson.build @@ -3,4 +3,4 @@ project('toplevel bar', 'c') subproject('foo') executable('bar', 'bar.c') -run_target('nop', 'true') +run_target('nop', command : ['true']) diff --git a/test cases/common/90 identical target name in subproject/subprojects/foo/meson.build b/test cases/common/90 identical target name in subproject/subprojects/foo/meson.build index a7a31b1..3f22337 100644 --- a/test cases/common/90 identical target name in subproject/subprojects/foo/meson.build +++ b/test cases/common/90 identical target name in subproject/subprojects/foo/meson.build @@ -1,4 +1,4 @@ project('subfoo', 'c') executable('bar', 'bar.c') -run_target('nop', 'true') +run_target('nop', command : ['true']) |