From d082204096afd51730f44a75bd02423f74c2e5ae Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Mon, 7 Feb 2022 15:58:30 -0500 Subject: mdist: fix dist scripts in subprojects being marked as superproject scripts This has never worked for built/found programs, only for script files. In commit 2fabd4c7dc22373e99fc63823d80083ad30704b8 scripts learned an attribute stating which subproject they came from. In commit 3990754bf55727ef5593769b48f0a03c6b7a3671 dist scripts learned to run even from a subproject, and relied on that attribute to know when, in fact, they came from a subproject. Unfortunately the original attribute was only set in one half of an if/else, and the other half returned early with only part of the work done. Fixes #9964 --- mesonbuild/interpreter/mesonmain.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/interpreter/mesonmain.py b/mesonbuild/interpreter/mesonmain.py index 74b5978..5781e03 100644 --- a/mesonbuild/interpreter/mesonmain.py +++ b/mesonbuild/interpreter/mesonmain.py @@ -87,13 +87,13 @@ class MesonMain(MesonInterpreterObject): FeatureNew.single_use(f'Passing executable/found program object to script parameter of {name}', '0.55.0', self.subproject, location=self.current_node) largs.append(prog) - largs.extend(args) - return self.interpreter.backend.get_executable_serialisation(largs) - elif isinstance(prog, mesonlib.File): - FeatureNew.single_use(f'Passing file object to script parameter of {name}', - '0.57.0', self.subproject, location=self.current_node) - found = self.interpreter.find_program_impl([prog]) - largs.append(found) + else: + if isinstance(prog, mesonlib.File): + FeatureNew.single_use(f'Passing file object to script parameter of {name}', + '0.57.0', self.subproject, location=self.current_node) + found = self.interpreter.find_program_impl([prog]) + largs.append(found) + largs.extend(args) es = self.interpreter.backend.get_executable_serialisation(largs) es.subproject = self.interpreter.subproject -- cgit v1.1