These options often don't exist for the build machine, as they're
generally invalid (ie, prefix, libdir, etc). So we should always check
for their existance as host optiuons, since all we want to know in this
case is if the option is yeilding (valid per-subproject), and build/vs
host doesn't matter in that cases:
Fixes#8613
Instead of treating native files as always being for the build machine,
and then copying them to the host machine, treat them as for the build
machine only when a cross file is also present
They are supposed to have different behavior. The environment variables
apply to both the compiler and linker when the compiler acts as a
linker, but the command line ones do not.
Fixes#8345
1. use `locale.getpreferredencoding()` to get encoding name.
`bytes.decode()` assumes `encoding='utf-8'` by default. It is incorrect on my
Windows setup, and causes `UnicodeDecodeError`.
2. use `errors='replace'`.
`bytes.decode()` assumes `errors='strict'` by default. Meson shouldn't crash
if subprocess outputs some garbage that can't be decoded.
`surrogateescape` doesn't work as expected on Windows. On Linux, default
`errors` for `sys.stdout` is `strict`, so `surrogateescape` can't be used there
too (at least until `sys.stdout` is reconfigured).
Fixes https://github.com/mesonbuild/meson/issues/8480
When using --reset we should guarantee that next reconfigure will pick
the latest code. For wrap-file we have no way to know if the revision
changed, so we have to delete the source tree and extract again.
It is unlikely that user has local changes in non-git subprojects, and
--reset is known to be dangerous.