From a6dbf2eec5a588678c4e66d2f8c1292eb6f8237c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Wed, 30 Oct 2024 15:53:52 +0100 Subject: [PATCH] ExternalProgram: add full_command to complete the offfering In case of python and especially in the case of pyInstaller where the python command is meson.exe runpython, it should not be full path to be used but full_command. Fixing #13834 --- mesonbuild/interpreter/interpreterobjects.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py index a919102607be..a8964df89978 100644 --- a/mesonbuild/interpreter/interpreterobjects.py +++ b/mesonbuild/interpreter/interpreterobjects.py @@ -618,7 +618,8 @@ def __init__(self, ep: _EXTPROG, interpreter: 'Interpreter') -> None: self.methods.update({'found': self.found_method, 'path': self.path_method, 'version': self.version_method, - 'full_path': self.full_path_method}) + 'full_path': self.full_path_method, + 'full_command': self.full_command_method }) @noPosargs @noKwargs @@ -645,6 +646,19 @@ def _full_path(self) -> str: assert path is not None return path + @noPosargs + @noKwargs + @FeatureNew('ExternalProgram.full_command', '1.6.1') + def full_command_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str: + return self._full_command() + + def _full_command(self) -> str: + if not self.found(): + raise InterpreterException('Unable to get the path of a not-found external program') + path = self.held_object.get_command() + assert path is not None + return path + @noPosargs @noKwargs @FeatureNew('ExternalProgram.version', '0.62.0')