aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-01-25 21:35:26 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-01-27 22:11:48 -0500
commitd9f55d774c6df52a8536114535d305841e96f105 (patch)
treeea9a5d32f35197fcb4ea5a405ceebd3c95de34e3 /mesonbuild/interpreter/interpreter.py
parent1913a4246c6a0c0204e29e4957cafa937b251d01 (diff)
downloadmeson-d9f55d774c6df52a8536114535d305841e96f105.zip
meson-d9f55d774c6df52a8536114535d305841e96f105.tar.gz
meson-d9f55d774c6df52a8536114535d305841e96f105.tar.bz2
add location data to various Feature checks
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r--mesonbuild/interpreter/interpreter.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 19e0f96..2502deb 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -546,7 +546,7 @@ class Interpreter(InterpreterBase, HoldableObject):
except KeyError:
continue
if len(di) == 1:
- FeatureNew.single_use('stdlib without variable name', '0.56.0', self.subproject)
+ FeatureNew.single_use('stdlib without variable name', '0.56.0', self.subproject, location=self.current_node)
kwargs = {'native': for_machine is MachineChoice.BUILD,
}
name = l + '_stdlib'
@@ -608,11 +608,11 @@ class Interpreter(InterpreterBase, HoldableObject):
variables = kwargs.get(argname, {})
if isinstance(variables, dict):
if dict_new and variables:
- FeatureNew.single_use(f'{argname} as dictionary', '0.56.0', self.subproject)
+ FeatureNew.single_use(f'{argname} as dictionary', '0.56.0', self.subproject, location=self.current_node)
else:
varlist = mesonlib.stringlistify(variables)
if list_new:
- FeatureNew.single_use(f'{argname} as list of strings', '0.56.0', self.subproject)
+ FeatureNew.single_use(f'{argname} as list of strings', '0.56.0', self.subproject, location=self.current_node)
variables = collections.OrderedDict()
for v in varlist:
try:
@@ -668,7 +668,7 @@ external dependencies (including libraries) must go to "dependencies".''')
kwargs: 'TYPE_kwargs') -> None:
value, message = args
if message is None:
- FeatureNew.single_use('assert function without message argument', '0.53.0', self.subproject)
+ FeatureNew.single_use('assert function without message argument', '0.53.0', self.subproject, location=node)
if not value:
if message is None:
@@ -1024,7 +1024,7 @@ external dependencies (including libraries) must go to "dependencies".''')
kwargs: 'TYPE_kwargs') -> build.ConfigurationData:
initial_values = args[0]
if initial_values is not None:
- FeatureNew.single_use('configuration_data dictionary', '0.49.0', self.subproject)
+ FeatureNew.single_use('configuration_data dictionary', '0.49.0', self.subproject, location=node)
for k, v in initial_values.items():
if not isinstance(v, (str, int ,bool)):
raise InvalidArguments(
@@ -1113,7 +1113,7 @@ external dependencies (including libraries) must go to "dependencies".''')
version = kwargs['version']
if isinstance(version, mesonlib.File):
- FeatureNew.single_use('version from file', '0.57.0', self.subproject)
+ FeatureNew.single_use('version from file', '0.57.0', self.subproject, location=node)
self.add_build_def_file(version)
ifname = version.absolute_path(self.environment.source_dir,
self.environment.build_dir)
@@ -1210,7 +1210,7 @@ external dependencies (including libraries) must go to "dependencies".''')
@noKwargs
def func_message(self, node, args, kwargs):
if len(args) > 1:
- FeatureNew.single_use('message with more than one argument', '0.54.0', self.subproject)
+ FeatureNew.single_use('message with more than one argument', '0.54.0', self.subproject, location=node)
args_str = [stringifyUserArguments(i) for i in args]
self.message_impl(args_str)
@@ -1286,7 +1286,7 @@ external dependencies (including libraries) must go to "dependencies".''')
@noKwargs
def func_warning(self, node, args, kwargs):
if len(args) > 1:
- FeatureNew.single_use('warning with more than one argument', '0.54.0', self.subproject)
+ FeatureNew.single_use('warning with more than one argument', '0.54.0', self.subproject, location=node)
args_str = [stringifyUserArguments(i) for i in args]
mlog.warning(*args_str, location=node)
@@ -1294,7 +1294,7 @@ external dependencies (including libraries) must go to "dependencies".''')
@noKwargs
def func_error(self, node, args, kwargs):
if len(args) > 1:
- FeatureNew.single_use('error with more than one argument', '0.58.0', self.subproject)
+ FeatureNew.single_use('error with more than one argument', '0.58.0', self.subproject, location=node)
args_str = [stringifyUserArguments(i) for i in args]
raise InterpreterException('Problem encountered: ' + ' '.join(args_str))
@@ -1331,7 +1331,7 @@ external dependencies (including libraries) must go to "dependencies".''')
# compilers we don't add anything for cython here, and instead do it
# When the first cython target using a particular language is used.
if 'vala' in langs and 'c' not in langs:
- FeatureNew.single_use('Adding Vala language without C', '0.59.0', self.subproject)
+ FeatureNew.single_use('Adding Vala language without C', '0.59.0', self.subproject, location=self.current_node)
args.append('c')
success = True
@@ -1668,7 +1668,7 @@ external dependencies (including libraries) must go to "dependencies".''')
if 'input' not in kwargs or 'output' not in kwargs:
raise InterpreterException('Keyword arguments input and output must exist')
if 'fallback' not in kwargs:
- FeatureNew.single_use('Optional fallback in vcs_tag', '0.41.0', self.subproject)
+ FeatureNew.single_use('Optional fallback in vcs_tag', '0.41.0', self.subproject, location=node)
fallback = kwargs.pop('fallback', self.project_version)
if not isinstance(fallback, str):
raise InterpreterException('Keyword argument fallback must be a string.')
@@ -1734,7 +1734,7 @@ external dependencies (including libraries) must go to "dependencies".''')
def func_custom_target(self, node: mparser.FunctionNode, args: T.Tuple[str],
kwargs: 'kwargs.CustomTarget') -> build.CustomTarget:
if kwargs['depfile'] and ('@BASENAME@' in kwargs['depfile'] or '@PLAINNAME@' in kwargs['depfile']):
- FeatureNew.single_use('substitutions in custom_target depfile', '0.47.0', self.subproject)
+ FeatureNew.single_use('substitutions in custom_target depfile', '0.47.0', self.subproject, location=node)
# Don't mutate the kwargs
kwargs = kwargs.copy()
@@ -1883,7 +1883,7 @@ external dependencies (including libraries) must go to "dependencies".''')
env = self.unpack_env_kwarg(kwargs)
if kwargs['timeout'] <= 0:
- FeatureNew.single_use('test() timeout <= 0', '0.57.0', self.subproject)
+ FeatureNew.single_use('test() timeout <= 0', '0.57.0', self.subproject, location=node)
prj = self.subproject if self.is_subproject() else self.build.project_name
@@ -2235,7 +2235,7 @@ external dependencies (including libraries) must go to "dependencies".''')
if 'configuration' in kwargs:
conf = kwargs['configuration']
if isinstance(conf, dict):
- FeatureNew.single_use('configure_file.configuration dictionary', '0.49.0', self.subproject)
+ FeatureNew.single_use('configure_file.configuration dictionary', '0.49.0', self.subproject, location=node)
for k, v in conf.items():
if not isinstance(v, (str, int ,bool)):
raise InvalidArguments(
@@ -2270,7 +2270,7 @@ external dependencies (including libraries) must go to "dependencies".''')
conf.used = True
elif 'command' in kwargs:
if len(inputs) > 1:
- FeatureNew.single_use('multiple inputs in configure_file()', '0.52.0', self.subproject)
+ FeatureNew.single_use('multiple inputs in configure_file()', '0.52.0', self.subproject, location=node)
# We use absolute paths for input and output here because the cwd
# that the command is run from is 'unspecified', so it could change.
# Currently it's builddir/subdir for in_builddir else srcdir/subdir.
@@ -2545,7 +2545,7 @@ external dependencies (including libraries) must go to "dependencies".''')
kwargs: 'TYPE_kwargs') -> build.EnvironmentVariables:
init = args[0]
if init is not None:
- FeatureNew.single_use('environment positional arguments', '0.52.0', self.subproject)
+ FeatureNew.single_use('environment positional arguments', '0.52.0', self.subproject, location=node)
msg = ENV_KW.validator(init)
if msg:
raise InvalidArguments(f'"environment": {msg}')