Proper error message for non-found exe in run_target. Closes #3818

pull/3752/merge
Jussi Pakkanen 7 years ago committed by GitHub
parent 7b2a07bcf9
commit dc683218a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      mesonbuild/interpreter.py
  2. 4
      test cases/failing/81 unfound run/meson.build

@ -3087,6 +3087,8 @@ root and issuing %s.
if not isinstance(i, (str, build.BuildTarget, build.CustomTarget, dependencies.ExternalProgram, mesonlib.File)): if not isinstance(i, (str, build.BuildTarget, build.CustomTarget, dependencies.ExternalProgram, mesonlib.File)):
mlog.debug('Wrong type:', str(i)) mlog.debug('Wrong type:', str(i))
raise InterpreterException('Invalid argument to run_target.') raise InterpreterException('Invalid argument to run_target.')
if isinstance(i, dependencies.ExternalProgram) and not i.found():
raise InterpreterException('Tried to use non-existing executable {!r}'.format(i.name))
cleaned_args.append(i) cleaned_args.append(i)
name = args[0] name = args[0]
if not isinstance(name, str): if not isinstance(name, str):

@ -0,0 +1,4 @@
project('unfound runtarget')
exe = find_program('nonexisting_prog', required : false)
run_target('invoke_fail', command : [exe])
Loading…
Cancel
Save