From 317a735b07f55f787256592ad7b376998b26234c Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Wed, 23 Mar 2016 21:26:55 +0200 Subject: [PATCH] Error out if using a not found binary in the build. Closes #469. --- mesonbuild/build.py | 2 ++ test cases/failing/28 noprog use/meson.build | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 test cases/failing/28 noprog use/meson.build diff --git a/mesonbuild/build.py b/mesonbuild/build.py index ab9d0d531..3f480e870 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -842,6 +842,8 @@ class CustomTarget: if isinstance(c, str): final_cmd.append(c) elif isinstance(c, dependencies.ExternalProgram): + if not c.found(): + raise InvalidArguments('Tried to use not found external program in a build rule.') final_cmd += c.get_command() elif isinstance(c, BuildTarget) or isinstance(c, CustomTarget): self.dependencies.append(c) diff --git a/test cases/failing/28 noprog use/meson.build b/test cases/failing/28 noprog use/meson.build new file mode 100644 index 000000000..e4de42fbd --- /dev/null +++ b/test cases/failing/28 noprog use/meson.build @@ -0,0 +1,9 @@ +project('using not found exe', 'c') + +nope = find_program('nonexisting', required : false) + +custom_target( 'aa', + input: 'meson.build', + output: 'foobar', + command: [nope, '@INPUT@', '@OUTPUT@'] +)