Creating the coverage option to ninja previously didn't work reliably.
This change re-orders the parameters passed to `meson setup` and seems
to work better. Additionally this change refactors the scripts and makes
use of `builder_run_action`.
Fixes#8373.
Note that the core functionality requested in #8373 is already in place;
this commit just does some cleanup to make this easier to maintain in
the future:
* Uses `builder_is_debug_build` function to test for debug build
(instead of `builder_has_option --debug`, which would also work but
using the other function avoids typo issues with the option name).
* Renames `$_builder_debug` to `$_builder_debug_internal` to reduce
naming confusion
* Documents `$builder_debug`, `builder_is_debug_build`, and clarifies
usage of `--debug` option.
* Logs command line for dep builds (we could hide this in the future,
but it certainly doesn't hurt for now!)
Paths that describe outputs are supposed to be relative to root,
not absolute. Also, it turns out we don't use the `--output`
parameter, so this change removes it.