On 8/4/24 23:04, Manos Pitsidianakis wrote:
diff --git a/rust/hw/char/pl011/meson.build b/rust/hw/char/pl011/meson.build
new file mode 100644
index 0000000000..a17a823cf5
--- /dev/null
+++ b/rust/hw/char/pl011/meson.build
@@ -0,0 +1,28 @@
+if not config_host_data.get('CONFIG_HAVE_RUST')
+  subdir_done()
+endif
+
+add_languages('rust', required: true)

These five lines are not necessary.

+arbitrary_int_dep = 
subproject('arbitrary-int').get_variable('arbitrary_int_dep')
+bilge_dep = subproject('bilge').get_variable('bilge_dep')
+bilge_impl_dep = subproject('bilge-impl').get_variable('bilge_impl_dep')

The subprojects also need to be added to scripts/archive-source.sh and scripts/make-release.

In order to simplify a future switch to Cargo projects, this should be something like:

subproject('bilge-0.2-rs', required: true)
subproject('bilge-impl-0.2-rs', required: true)

bilge_dep = dependency('bilge-0.2-rs')
bilge_impl_dep = dependency('bilge-impl-0.2-rs')

with a corresponding

meson.override_dependency('bilge-0.2-rs', bilge_dep)

in subprojects/packagefiles/bilge-0.2-rs/meson.build.

Also in bilge's meson.build:

+arbitrary_int_dep = 
subproject('arbitrary-int').get_variable('arbitrary_int_dep')
+bilge_impl_dep = subproject('bilge-impl').get_variable('bilge_impl_dep')
+
+lib = static_library(
+  'bilge',
+  'src/lib.rs',
+  override_options : ['rust_std=2021', 'build.rust_std=2021'],
+  rust_abi : 'rust',
+  native : true,
+  dependencies: [

native should not be true here (but it should be true for the dependencies of bilge-impl: either, itertools, proc-macro-error, proc-macro-error-attr, proc-macro2, quote, syn, unicode-ident).

I've placed my updates at a branch "rust-for-manos" of https://gitlab.com/bonzini/qemu/. I left the fixes unsquashed for your review, but feel free to merge them and post the result as part of v7.

Paolo


Reply via email to