In cases where a script module function returns
void, while also calling an internal function which
does not return void, the return type of the internal
function ends up as the expected return type of the
outer void-returning function, yielding type failure.
Admittedly this is a very contrived example and only
likely to show up when prototyping new script modules
but it was nonetheless causing me difficulties in
exactly that situation so I have fixed it and
extended the script_module test to cover this case.
Functions are now analyzed when they are defined so they aren't
erroneously marked as dead code. This led to some weird typechecking
issues that ended up pushing me to clean up some of the typechecking
code.
This is currently undefined behavior, but users are relying on it, so
let's align ourselves with Meson.
See https://github.com/mesonbuild/meson/issues/12370
Signed-off-by: Filipe Laíns <lains@riseup.net>
This behavior is an ugly hack in meson, and not documented. It is also
trivially avoidable at the user level. Based on this, I'm not going to
add it to muon for now at least.
- set the cache key earlier so that error returns have a key to cache
the erroneous result with
- some returns must happen before the key is built, in which case we
cannot cache the result, so just skip it
Some meson.builds intentionally do path / '' to add a '/' to the end of
path. muon would end up stripping the trailing path separator in
path_normalize, so path / '' was a no-op. Allow the meson behavior by
explicitly appending the '/' with path_add_suffix.
- separate install functionality to install.c and
functions/kernel/install.c
- remove specialized install functions that are only used in 1 place
- implement preserve_path for push_install_targets