Refactor to use ExternalProgram for the command instead of duplicating
that code (badly). Also improve messages to say "or not executable"
when a script/command is not found.
Also allow ExternalPrograms to be passed as arguments to
run_command(). The only thing we're doing by preventing that is
forcing people to use prog.path()
We automatically convert that to use sys.executable now which is
always available on all platforms (because we're running with it).
On some platforms like NetBSD, `python` doesn't exist, and you must
use a specific python version. On most other distros, `python` is
Python 2, and we don't want to depend on that.
Closes https://github.com/mesonbuild/meson/issues/695
All these scripts were being used as `find_program()`, so we do not
lose any test coverage by doing this.
And actually test that prog.path() works. The earlier test was just
running the command without checking if it succeeded.
Also make everything use prog.get_command() or get_path() instead of
accessing the internal member prog.fullpath directly.