qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rust: workaround compilation failures with Meson <1.10
@ 2025-11-28  9:42 Paolo Bonzini
  0 siblings, 0 replies; only message in thread
From: Paolo Bonzini @ 2025-11-28  9:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

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.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/util/meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rust/util/meson.build b/rust/util/meson.build
index 95aa211ef0b..2aa32a233eb 100644
--- a/rust/util/meson.build
+++ b/rust/util/meson.build
@@ -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],
-- 
2.51.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-28  9:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-28  9:42 [PATCH] rust: workaround compilation failures with Meson <1.10 Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).