aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-02-09 23:36:35 -0500
committerEli Schwartz <eschwartz@archlinux.org>2023-02-09 23:51:42 -0500
commita846fa3352cd6353c50cb6c46e7782110423d646 (patch)
tree9d0f16fc52113894a3482ad3872932f24f9feba5 /mesonbuild/interpreter/interpreter.py
parentd0b39a6872719756e77523dc60dbce94470ecba8 (diff)
downloadmeson-a846fa3352cd6353c50cb6c46e7782110423d646.zip
meson-a846fa3352cd6353c50cb6c46e7782110423d646.tar.gz
meson-a846fa3352cd6353c50cb6c46e7782110423d646.tar.bz2
respect the machine file binary overrides, even if it doesn't exist
If someone specifies a binary in a machine file, but the resulting prog.found() is false because it doesn't actually exist on disk, then the user was probably trying to disable finding that program. But find_program() currently doesn't distinguish between a machine file lookup returning a not-found program, and returning a dummy program because there's no entry at all. Explicitly check for a dummy program, rather than checking if the program was found, before deciding whether to discard the lookup results and continue trying other program lookup methods.
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r--mesonbuild/interpreter/interpreter.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 802c862..b740846 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1484,7 +1484,9 @@ class Interpreter(InterpreterBase, HoldableObject):
if not isinstance(p, str):
raise InterpreterException('Executable name must be a string')
prog = ExternalProgram.from_bin_list(self.environment, for_machine, p)
- if prog.found():
+ # if the machine file specified something, it may be a regular
+ # not-found program but we still want to return that
+ if not isinstance(prog, NonExistingExternalProgram):
return prog
return None