[PATCH 03/19] rust: do not add qemuutil to Rust crates

Paolo Bonzini posted 19 patches 4 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, Manos Pitsidianakis <manos.pitsidianakis@linaro.org>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>
There is a newer version of this series
[PATCH 03/19] rust: do not add qemuutil to Rust crates
Posted by Paolo Bonzini 4 months ago
This fails due to https://github.com/mesonbuild/meson/pull/15076.
The config-host.h file from the qemuutil dependency ends up on the
rustc command line for targets that do not use structured sources.

It will be reverted once Meson 1.9.2 is released, or replaced with
an update of the minimum supported version of Meson if 1.9.2 is
released sooner.

Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/chardev/meson.build | 2 +-
 rust/util/meson.build    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/rust/chardev/meson.build b/rust/chardev/meson.build
index d365d8dd0f4..36ada7c4546 100644
--- a/rust/chardev/meson.build
+++ b/rust/chardev/meson.build
@@ -39,4 +39,4 @@ _chardev_rs = static_library(
   dependencies: [glib_sys_rs, common_rs, qemu_macros],
 )
 
-chardev_rs = declare_dependency(link_with: [_chardev_rs], dependencies: [chardev, qemuutil])
+chardev_rs = declare_dependency(link_with: [_chardev_rs], dependencies: [chardev])
diff --git a/rust/util/meson.build b/rust/util/meson.build
index b0b75e93ff6..8ad344dccbd 100644
--- a/rust/util/meson.build
+++ b/rust/util/meson.build
@@ -43,7 +43,7 @@ _util_rs = static_library(
   dependencies: [anyhow_rs, libc_rs, foreign_rs, glib_sys_rs, common_rs, qom, qemuutil],
 )
 
-util_rs = declare_dependency(link_with: [_util_rs], dependencies: [qemuutil, qom])
+util_rs = declare_dependency(link_with: [_util_rs])
 
 rust.test('rust-util-tests', _util_rs,
           dependencies: [qemuutil, qom],
-- 
2.51.0


Re: [PATCH 03/19] rust: do not add qemuutil to Rust crates
Posted by Markus Armbruster 2 months, 1 week ago
Paolo Bonzini <pbonzini@redhat.com> writes:

> This fails due to https://github.com/mesonbuild/meson/pull/15076.
> The config-host.h file from the qemuutil dependency ends up on the
> rustc command line for targets that do not use structured sources.
>
> It will be reverted once Meson 1.9.2 is released, or replaced with
> an update of the minimum supported version of Meson if 1.9.2 is
> released sooner.

I tend to put reminder comments next to such temporary workarounds, so I
don't forget to revert them.

> Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/chardev/meson.build | 2 +-
>  rust/util/meson.build    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/rust/chardev/meson.build b/rust/chardev/meson.build
> index d365d8dd0f4..36ada7c4546 100644
> --- a/rust/chardev/meson.build
> +++ b/rust/chardev/meson.build
> @@ -39,4 +39,4 @@ _chardev_rs = static_library(
>    dependencies: [glib_sys_rs, common_rs, qemu_macros],
>  )
>  
> -chardev_rs = declare_dependency(link_with: [_chardev_rs], dependencies: [chardev, qemuutil])
> +chardev_rs = declare_dependency(link_with: [_chardev_rs], dependencies: [chardev])
> diff --git a/rust/util/meson.build b/rust/util/meson.build
> index b0b75e93ff6..8ad344dccbd 100644
> --- a/rust/util/meson.build
> +++ b/rust/util/meson.build
> @@ -43,7 +43,7 @@ _util_rs = static_library(
>    dependencies: [anyhow_rs, libc_rs, foreign_rs, glib_sys_rs, common_rs, qom, qemuutil],
>  )
>  
> -util_rs = declare_dependency(link_with: [_util_rs], dependencies: [qemuutil, qom])
> +util_rs = declare_dependency(link_with: [_util_rs])
>  
>  rust.test('rust-util-tests', _util_rs,
>            dependencies: [qemuutil, qom],
Re: [PATCH 03/19] rust: do not add qemuutil to Rust crates
Posted by Paolo Bonzini 2 months ago
On 12/5/25 09:30, Markus Armbruster wrote:
> Paolo Bonzini <pbonzini@redhat.com> writes:
> 
>> This fails due to https://github.com/mesonbuild/meson/pull/15076.
>> The config-host.h file from the qemuutil dependency ends up on the
>> rustc command line for targets that do not use structured sources.
>>
>> It will be reverted once Meson 1.9.2 is released, or replaced with
>> an update of the minimum supported version of Meson if 1.9.2 is
>> released sooner.
> 
> I tend to put reminder comments next to such temporary workarounds, so I
> don't forget to revert them.

It turns out it wasn't temporary 
(https://lore.kernel.org/qemu-devel/20251127132036.84384-9-pbonzini@redhat.com). 
  I'll post a separate update-meson-and-clean-up-rust/ series once Meson 
1.10 is out (which is soon, and I've already tested the rc with QEMU).

Paolo

>> Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>   rust/chardev/meson.build | 2 +-
>>   rust/util/meson.build    | 2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/rust/chardev/meson.build b/rust/chardev/meson.build
>> index d365d8dd0f4..36ada7c4546 100644
>> --- a/rust/chardev/meson.build
>> +++ b/rust/chardev/meson.build
>> @@ -39,4 +39,4 @@ _chardev_rs = static_library(
>>     dependencies: [glib_sys_rs, common_rs, qemu_macros],
>>   )
>>   
>> -chardev_rs = declare_dependency(link_with: [_chardev_rs], dependencies: [chardev, qemuutil])
>> +chardev_rs = declare_dependency(link_with: [_chardev_rs], dependencies: [chardev])
>> diff --git a/rust/util/meson.build b/rust/util/meson.build
>> index b0b75e93ff6..8ad344dccbd 100644
>> --- a/rust/util/meson.build
>> +++ b/rust/util/meson.build
>> @@ -43,7 +43,7 @@ _util_rs = static_library(
>>     dependencies: [anyhow_rs, libc_rs, foreign_rs, glib_sys_rs, common_rs, qom, qemuutil],
>>   )
>>   
>> -util_rs = declare_dependency(link_with: [_util_rs], dependencies: [qemuutil, qom])
>> +util_rs = declare_dependency(link_with: [_util_rs])
>>   
>>   rust.test('rust-util-tests', _util_rs,
>>             dependencies: [qemuutil, qom],
> 
> 
>