summaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2025-10-15 21:49:10 -0400
committerEli Schwartz <eschwartz93@gmail.com>2025-10-15 23:01:36 -0400
commit5c0aad57f92d2a6bebc1cb17655dd8a56f4bcd3f (patch)
tree69a228a10f425b33392df576f79bd8b7c5402104 /mesonbuild/backend/backends.py
parent1177e77c2893891cb35144b8033786cb8f75c7cd (diff)
downloadmeson-5c0aad57f92d2a6bebc1cb17655dd8a56f4bcd3f.tar.gz
revert local_program()
This reverts https://github.com/mesonbuild/meson/pull/15107 Explicit objections regarding the design were raised and not answered, so it shouldn't have been merged. It needs to be discussed and revisited.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index a322c9882..a5995e6b1 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -529,7 +529,7 @@ class Backend:
return result
def get_executable_serialisation(
- self, cmd: T.Sequence[T.Union[programs.ExternalProgram, build.BuildTarget, build.CustomTarget, build.CustomTargetIndex, File, str, build.LocalProgram]],
+ self, cmd: T.Sequence[T.Union[programs.ExternalProgram, build.BuildTarget, build.CustomTarget, File, str]],
workdir: T.Optional[str] = None,
extra_bdeps: T.Optional[T.List[build.BuildTarget]] = None,
capture: T.Optional[str] = None,
@@ -542,15 +542,13 @@ class Backend:
# XXX: cmd_args either need to be lowered to strings, or need to be checked for non-string arguments, right?
exe, *raw_cmd_args = cmd
- if isinstance(exe, build.LocalProgram):
- exe = exe.program
if isinstance(exe, programs.ExternalProgram):
exe_cmd = exe.get_command()
exe_for_machine = exe.for_machine
elif isinstance(exe, build.BuildTarget):
exe_cmd = [self.get_target_filename_abs(exe)]
exe_for_machine = exe.for_machine
- elif isinstance(exe, (build.CustomTarget, build.CustomTargetIndex)):
+ elif isinstance(exe, build.CustomTarget):
# The output of a custom target can either be directly runnable
# or not, that is, a script, a native binary or a cross compiled
# binary when exe wrapper is available and when it is not.
@@ -567,11 +565,9 @@ class Backend:
cmd_args: T.List[str] = []
for c in raw_cmd_args:
- if isinstance(c, build.LocalProgram):
- c = c.program
if isinstance(c, programs.ExternalProgram):
cmd_args += c.get_command()
- elif isinstance(c, (build.BuildTarget, build.CustomTarget, build.CustomTargetIndex)):
+ elif isinstance(c, (build.BuildTarget, build.CustomTarget)):
cmd_args.append(self.get_target_filename_abs(c))
elif isinstance(c, mesonlib.File):
cmd_args.append(c.rel_to_builddir(self.environment.source_dir))