aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-12-26 18:04:57 -0500
committerEli Schwartz <eschwartz@archlinux.org>2021-12-30 15:14:18 -0500
commitcb6a6dbca4d117bd2b6fe7a516887fcd5342b4f2 (patch)
treefcf4b1c9485d74a4f80e8943c8d97d7631316267
parent6e25548d06966a20bf7e5cc1fef184c4334c42df (diff)
downloadmeson-cb6a6dbca4d117bd2b6fe7a516887fcd5342b4f2.zip
meson-cb6a6dbca4d117bd2b6fe7a516887fcd5342b4f2.tar.gz
meson-cb6a6dbca4d117bd2b6fe7a516887fcd5342b4f2.tar.bz2
remove no longer needed validation routine
We don't need to check when processing the script args, whether the correct types were passed. We check this upfront in typed_pos_args now.
-rw-r--r--mesonbuild/interpreter/mesonmain.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/mesonbuild/interpreter/mesonmain.py b/mesonbuild/interpreter/mesonmain.py
index 819ff7f..be1acc6 100644
--- a/mesonbuild/interpreter/mesonmain.py
+++ b/mesonbuild/interpreter/mesonmain.py
@@ -104,7 +104,7 @@ class MesonMain(MesonInterpreterObject):
str, mesonlib.File, build.BuildTarget, build.CustomTarget,
build.CustomTargetIndex,
ExternalProgram,
- ]], allow_built: bool = False) -> T.List[str]:
+ ]]) -> T.List[str]:
script_args = [] # T.List[str]
new = False
for a in args:
@@ -114,8 +114,6 @@ class MesonMain(MesonInterpreterObject):
new = True
script_args.append(a.rel_to_builddir(self.interpreter.environment.source_dir))
elif isinstance(a, (build.BuildTarget, build.CustomTarget, build.CustomTargetIndex)):
- if not allow_built:
- raise InterpreterException(f'Arguments to {name} cannot be built')
new = True
script_args.extend([os.path.join(a.get_subdir(), o) for o in a.get_outputs()])
@@ -153,7 +151,7 @@ class MesonMain(MesonInterpreterObject):
args: T.Tuple[T.Union[str, mesonlib.File, build.Executable, ExternalProgram],
T.List[T.Union[str, mesonlib.File, build.BuildTarget, build.CustomTarget, build.CustomTargetIndex, ExternalProgram]]],
kwargs: 'AddInstallScriptKW') -> None:
- script_args = self._process_script_args('add_install_script', args[1], allow_built=True)
+ script_args = self._process_script_args('add_install_script', args[1])
script = self._find_source_script('add_install_script', args[0], script_args)
script.skip_if_destdir = kwargs['skip_if_destdir']
script.tag = kwargs['install_tag']
@@ -170,7 +168,7 @@ class MesonMain(MesonInterpreterObject):
args: T.Tuple[T.Union[str, mesonlib.File, ExternalProgram],
T.List[T.Union[str, mesonlib.File, ExternalProgram]]],
kwargs: 'TYPE_kwargs') -> None:
- script_args = self._process_script_args('add_postconf_script', args[1], allow_built=False)
+ script_args = self._process_script_args('add_postconf_script', args[1])
script = self._find_source_script('add_postconf_script', args[0], script_args)
self.build.postconf_scripts.append(script)
@@ -191,7 +189,7 @@ class MesonMain(MesonInterpreterObject):
if self.interpreter.subproject != '':
FeatureNew.single_use('Calling "add_dist_script" in a subproject',
'0.58.0', self.interpreter.subproject)
- script_args = self._process_script_args('add_dist_script', args[1], allow_built=False)
+ script_args = self._process_script_args('add_dist_script', args[1])
script = self._find_source_script('add_dist_script', args[0], script_args)
self.build.dist_scripts.append(script)