summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
diff options
context:
space:
mode:
authorXavier Claessens <xclaessens@netflix.com>2025-10-12 10:20:47 -0400
committerXavier Claessens <xclaesse@gmail.com>2025-10-15 12:15:39 -0400
commitbd33265b04ca609afe6bb895453c5757bbbbb27d (patch)
tree03b87a92694d2f7821612f6405540cc0e044ab6d /mesonbuild/interpreter/interpreter.py
parent4795475595ef6b87074df9e38d09a3dff2690396 (diff)
downloadmeson-bd33265b04ca609afe6bb895453c5757bbbbb27d.tar.gz
Replace OverrideExecutable and OverrideProgram with LocalProgram
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r--mesonbuild/interpreter/interpreter.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 62922c2b3..552e1331b 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -118,7 +118,6 @@ if T.TYPE_CHECKING:
from ..backend.backends import Backend
from ..interpreterbase.baseobjects import InterpreterObject, TYPE_var, TYPE_kwargs
from ..options import OptionDict
- from ..programs import OverrideProgram
from .type_checking import SourcesVarargsType
# Input source types passed to Targets
@@ -130,7 +129,7 @@ if T.TYPE_CHECKING:
BuildTargetSource = T.Union[mesonlib.FileOrString, build.GeneratedTypes, build.StructuredSources]
- ProgramVersionFunc = T.Callable[[T.Union[ExternalProgram, build.Executable, OverrideProgram]], str]
+ ProgramVersionFunc = T.Callable[[T.Union[ExternalProgram, build.LocalProgram]], str]
TestClass = T.TypeVar('TestClass', bound=Test)
@@ -441,7 +440,6 @@ class Interpreter(InterpreterBase, HoldableObject):
build.Generator: OBJ.GeneratorHolder,
build.GeneratedList: OBJ.GeneratedListHolder,
build.ExtractedObjects: OBJ.GeneratedObjectsHolder,
- build.OverrideExecutable: OBJ.OverrideExecutableHolder,
build.LocalProgram: OBJ.LocalProgramHolder,
build.RunTarget: OBJ.RunTargetHolder,
build.AliasTarget: OBJ.AliasTargetHolder,
@@ -1623,7 +1621,7 @@ class Interpreter(InterpreterBase, HoldableObject):
def program_from_overrides(self, command_names: T.List[mesonlib.FileOrString],
extra_info: T.List['mlog.TV_Loggable']
- ) -> T.Optional[T.Union[ExternalProgram, OverrideProgram, build.OverrideExecutable, build.LocalProgram]]:
+ ) -> T.Optional[T.Union[ExternalProgram, build.LocalProgram]]:
for name in command_names:
if not isinstance(name, str):
continue
@@ -1638,7 +1636,7 @@ class Interpreter(InterpreterBase, HoldableObject):
if isinstance(name, str):
self.build.searched_programs.add(name)
- def add_find_program_override(self, name: str, exe: T.Union[build.OverrideExecutable, ExternalProgram, OverrideProgram, build.LocalProgram]) -> None:
+ def add_find_program_override(self, name: str, exe: T.Union[ExternalProgram, build.LocalProgram]) -> None:
if name in self.build.searched_programs:
raise InterpreterException(f'Tried to override finding of executable "{name}" which has already been found.')
if name in self.build.find_overrides:
@@ -1663,7 +1661,7 @@ class Interpreter(InterpreterBase, HoldableObject):
search_dirs: T.Optional[T.List[str]] = None,
version_arg: T.Optional[str] = '',
version_func: T.Optional[ProgramVersionFunc] = None
- ) -> T.Union[ExternalProgram, build.OverrideExecutable, OverrideProgram, build.LocalProgram]:
+ ) -> T.Union[ExternalProgram, build.LocalProgram]:
args = mesonlib.listify(args)
extra_info: T.List[mlog.TV_Loggable] = []
@@ -1695,7 +1693,7 @@ class Interpreter(InterpreterBase, HoldableObject):
version_arg: T.Optional[str],
version_func: T.Optional[ProgramVersionFunc],
extra_info: T.List[mlog.TV_Loggable]
- ) -> T.Optional[T.Union[ExternalProgram, build.Executable, OverrideProgram, build.LocalProgram]]:
+ ) -> T.Optional[T.Union[ExternalProgram, build.LocalProgram]]:
progobj = self.program_from_overrides(args, extra_info)
if progobj:
return progobj
@@ -1731,7 +1729,7 @@ class Interpreter(InterpreterBase, HoldableObject):
return progobj
- def check_program_version(self, progobj: T.Union[ExternalProgram, build.Executable, OverrideProgram, build.LocalProgram],
+ def check_program_version(self, progobj: T.Union[ExternalProgram, build.LocalProgram],
wanted: T.Union[str, T.List[str]],
version_func: T.Optional[ProgramVersionFunc],
extra_info: T.List[mlog.TV_Loggable]) -> bool:
@@ -1758,7 +1756,7 @@ class Interpreter(InterpreterBase, HoldableObject):
def find_program_fallback(self, fallback: str, args: T.List[mesonlib.FileOrString],
default_options: OptionDict,
required: bool, extra_info: T.List[mlog.TV_Loggable]
- ) -> T.Optional[T.Union[ExternalProgram, build.Executable, OverrideProgram]]:
+ ) -> T.Optional[T.Union[ExternalProgram, build.LocalProgram]]:
mlog.log('Fallback to subproject', mlog.bold(fallback), 'which provides program',
mlog.bold(' '.join(args)))
sp_kwargs: kwtypes.DoSubproject = {
@@ -1785,7 +1783,7 @@ class Interpreter(InterpreterBase, HoldableObject):
@disablerIfNotFound
def func_find_program(self, node: mparser.BaseNode, args: T.Tuple[T.List[mesonlib.FileOrString]],
kwargs: 'kwtypes.FindProgram',
- ) -> T.Union['build.Executable', ExternalProgram, 'OverrideProgram']:
+ ) -> T.Union[ExternalProgram, build.LocalProgram]:
disabled, required, feature = extract_required_kwarg(kwargs, self.subproject)
if disabled:
assert feature, 'for mypy'