summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-01-13 21:34:41 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-01-14 20:16:48 +0200
commit268d900ed139ad9f5f8f03861417db4c15ebe400 (patch)
tree38835c94a36312d7c5b9107118923765e592f5e0
parent81100f0695c595f4c0020034284846cea7e8e6aa (diff)
downloadmeson-removedepr.tar.gz
Removed two deprecations from 2016.removedepr
-rw-r--r--docs/markdown/snippets/deprecations.md14
-rw-r--r--mesonbuild/interpreter.py15
-rw-r--r--test cases/common/58 run target/meson.build3
-rw-r--r--test cases/common/90 identical target name in subproject/meson.build2
-rw-r--r--test cases/common/90 identical target name in subproject/subprojects/foo/meson.build2
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 000000000..adab2e6de
--- /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 c30c00f33..dfef87d28 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])
@@ -2127,7 +2125,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
@@ -2436,15 +2434,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 686db1f81..93a4ad0f2 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 98e489179..e804d3cda 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 a7a31b13b..3f2233775 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'])