mesonbuild/meson

Warn when build files use `object.path()` in places where `object` should be used

Open

#2,742 opened on Dec 6, 2017

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Python (4,978 stars) (1,465 forks)batch import
enhancementhelp wantedparser/interpreter

Description

If script.sh exists, has a shebang but is not executable then the following two lines will case an error when trying to invoke the run target.

myscript = find_program('script.sh')
run_target('myscript', command : myscript.path())

I could not track down the exact cause of the problem. When meson searches for the program it will recognize that the file is not executable and look for the shebang. (It might be a good idea to warn about this on *nix platforms.) It then identifies the interpreter and creates an external program with the interpreter and the script file.

When trying to invoke the program in run_script_command the interpreter is lost and we fail to execute the non-executable script.

Contributor guide