Skip to contentSkip to conversation

rust: workaround compilation failures with Meson <1.10

PATCH New Paolo Bonzini 1 participant 1 message Nov 28, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: workaround compilation failures with Meson <1.10

Prior to Meson 1.10, if the config-host.h dependency of qemuutil ends up as the first source file, it can be passed to rustc---which gets rather confused because config-host.h looks nothing like Rust code.

While this can usually be avoided in the individual targets, a simple and universal workaround is to remove the sources (and C compile arguments, while at it) from the "util_rs" dependency. This hides config-host.h from the Rust targets---and they don't need it anyway.

---
 rust/util/meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
rust/util/meson.build +3 -1
index 95aa211ef0b..2aa32a233eb 100644
@@ -41,7 +41,9 @@ _util_rs = static_library(
   dependencies: [anyhow_rs, libc_rs, foreign_rs, glib_sys_rs, common_rs],
 )
 
-util_rs = declare_dependency(link_with: [_util_rs], dependencies: [qemuutil, qom])
+util_rs = declare_dependency(link_with: [_util_rs], dependencies: [
+  qemuutil.partial_dependency(links: true, link_args: true),
+  qom])
 
 rust.test('rust-util-tests', _util_rs,
           dependencies: [qemuutil, qom],
Signature · 1 line
2.51.1