In commit 928078982c a good error message
about the directory not being a valid build directory, was replaced by a
worse message.
In commit abaa980436 the error message was
replaced by a traceback when trying to load the coredata before checking
if it was a build directory.
Revert back to using the helper function with the good error message.
Reorganize code so that we check basic things first, and do less work
before detecting errors.
Fixes#9584
meson compile itself doesn't permit GNU-style argument permutation, i.e.
TARGET to precede options, so why should we expect ninja to?
And indeed, ninja doesn't document support for this -- but it does
accept it anyway, which is confusing and results in people thinking it's
"supposed to" work.
However, if NINJA=samu then this is in fact enforced. samu does not
permit GNU-style argument permutation. As a result, the arguments passed
to mcompile are actively re-ordered before being passed to the
subprocess, and samu dies with a fatal error.
Fix ordering in mcompile.py and add a comment to warn future readers
that the order does, in fact, matter.
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
The ninja path is already logged as part of configure. Logging it
again every time when using meson compile is overly verbose and
doesn't add much value for the user.
I wrote this to convert run_tests.get_backend_commands() over to the
new meson wrappers, but that turned out to be harder than I expected,
so just splitting this out for now.
This allows the NINJA environment variable to support all the Windows special
cases, especially allowing an absolute path without extension.
Based on a patch by Yonggang Luo.
Fixes: #7659
Suggested-by: Nirbheek Chauhan <nirbheek@centricular.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This matches `meson test`, and there's really no other meaning that
could be attributed to this, since you would call `meson` to get the
version, not the `compile` sub-command.
D lang compilers have an option -release (or similar) which turns off
asserts, contracts, and other runtime type checking. This patch wires
that up to the b_ndebug flag.
Fixes#7082
With this running `meson compile` inside the builddir actually works,
and you don't have to do `meson compile -C .`
Clearly this was the intent since the option already has `default='.'`