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
This allows us to remove the unit test directory, and removes one of the
consumers of path.c. Some of these functions may also be useful for
internal scripts.
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
I tried to fix this by ending the argstr in a triple NUL, but that has
an edge case when the last element of argv is empty. This time fix it
more robustly by tracking argc separately.
The initial env implementation assumed that append/prepend only worked
on values that were previously set in the environment() object. In
reality, these are supposed to apply to the current environment if
the key has not been env.set() previously.