Skip to content

Commit

Permalink
ExternalProgram: add full_command to complete the offfering
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dabrain34 committed Oct 30, 2024
1 parent 1feb771 commit a6dbf2e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion mesonbuild/interpreter/interpreterobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand Down

0 comments on commit a6dbf2e

Please sign in to comment.