From 9ce3478410e6d9769f4203687b1f074a64c0ac8e Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Tue, 2 Dec 2025 11:48:08 +0100 Subject: [PATCH 1/3] meson: ignore subprojects/.wraplock When asking Meson to wrap subprojects, it generates a .wraplock file in the subprojects/ directory. Ignore this file. See also https://github.com/mesonbuild/meson/issues/14948. Signed-off-by: Toon Claes Acked-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- subprojects/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 63ea916ef5..2bb68c8794 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -1 +1,2 @@ /*/ +.wraplock From 574ac610761495b7b7afcced7717188501402925 Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Tue, 2 Dec 2025 11:48:09 +0100 Subject: [PATCH 2/3] meson: only detect ICONV_OMITS_BOM if possible In our Meson setup it automatically detects whether ICONV_OMITS_BOM should be defined. To check this, a piece of code is compiled and ran. When cross-compiling, it's not possible to run this piece of code. Guard this test with a can_run_host_binaries() check to ensure it can run. Signed-off-by: Toon Claes Acked-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f1b3615659..95348e69a4 100644 --- a/meson.build +++ b/meson.build @@ -1064,7 +1064,7 @@ if iconv.found() } ''' - if compiler.run(iconv_omits_bom_source, + if meson.can_run_host_binaries() and compiler.run(iconv_omits_bom_source, dependencies: iconv, name: 'iconv omits BOM', ).returncode() != 0 From 4061692ba427af2085e934e0734926f93ea2c823 Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Wed, 3 Dec 2025 15:53:31 +0100 Subject: [PATCH 3/3] meson: use is_cross_build() where possible In previous commit the first use of meson.can_run_host_binaries() was introduced. This is a guard around compiler.run() to ensure it's actually possible to execute the provided. In other places we've been having the same issue, but here `not meson.is_cross_build()` is used as guard. This does the trick, but it also prevents the code from running even when an exe_wrapper is configured. Switch to using meson.can_run_host_binaries() here as well. There is another place left that still uses `not meson.is_cross_build()`, but here it's a guard around fs.exists(). That function will always run on the build machine, so checking for cross-compilation is still in place here. Signed-off-by: Toon Claes Acked-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 95348e69a4..00ad8a5c60 100644 --- a/meson.build +++ b/meson.build @@ -1492,7 +1492,7 @@ if not has_bsd_sysctl endif endif -if not meson.is_cross_build() and compiler.run(''' +if meson.can_run_host_binaries() and compiler.run(''' #include int main(int argc, const char **argv)