qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] rust: build system and other cleanups
@ 2025-11-27 13:20 Paolo Bonzini
  2025-11-27 13:20 ` [PATCH 1/9] rust: remove leftover bindings/ Paolo Bonzini
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Paolo Bonzini @ 2025-11-27 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

A few small changes that I accumulated or received from others.

Paolo

Marc-André Lureau (1):
  rust: remove leftover bindings/

Martin Kletzander (1):
  rust: Do not link qemuutil into Rust rlibs

Paolo Bonzini (7):
  rust: remove unused --cfg arguments
  rust: remove unnecessary repetitive options
  rust/bql: make bindings public
  rust: do not copy the SysBusDevice
  rust: fix reference to MemoryRegion
  rust: move strict lints handling to meson.build
  rust: only link the Rust part of the code into devices

 meson.build                                   | 10 +--
 rust/bindings/src/lib.rs                      | 64 -------------------
 rust/bits/meson.build                         |  2 -
 rust/bql/meson.build                          |  2 -
 rust/bql/src/cell.rs                          |  2 +-
 rust/bql/src/lib.rs                           |  2 +-
 rust/chardev/meson.build                      |  4 +-
 rust/common/meson.build                       |  2 -
 rust/hw/char/pl011/meson.build                | 18 +++---
 rust/hw/core/src/sysbus.rs                    |  2 +-
 rust/hw/timer/hpet/meson.build                | 16 ++---
 rust/migration/meson.build                    |  2 -
 rust/qemu-macros/meson.build                  |  6 --
 rust/qom/meson.build                          |  4 +-
 rust/system/meson.build                       |  2 -
 rust/tests/meson.build                        |  1 -
 rust/trace/meson.build                        |  2 -
 rust/util/meson.build                         |  6 +-
 scripts/rust/rustc_args.py                    | 20 +-----
 .../bilge-impl-0.2-rs/meson.build             |  3 -
 .../proc-macro-error-1-rs/meson.build         |  1 -
 .../proc-macro-error-attr-1-rs/meson.build    |  3 -
 22 files changed, 32 insertions(+), 142 deletions(-)
 delete mode 100644 rust/bindings/src/lib.rs

-- 
2.51.1



^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/9] rust: remove leftover bindings/
  2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
@ 2025-11-27 13:20 ` Paolo Bonzini
  2025-12-03  9:11   ` Zhao Liu
  2025-11-27 13:20 ` [PATCH 2/9] rust: remove unused --cfg arguments Paolo Bonzini
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2025-11-27 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 rust/bindings/src/lib.rs | 64 ----------------------------------------
 1 file changed, 64 deletions(-)
 delete mode 100644 rust/bindings/src/lib.rs

diff --git a/rust/bindings/src/lib.rs b/rust/bindings/src/lib.rs
deleted file mode 100644
index 4c9bb794f79..00000000000
--- a/rust/bindings/src/lib.rs
+++ /dev/null
@@ -1,64 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-#![allow(
-    dead_code,
-    improper_ctypes_definitions,
-    improper_ctypes,
-    non_camel_case_types,
-    non_snake_case,
-    non_upper_case_globals,
-    unsafe_op_in_unsafe_fn,
-    clippy::pedantic,
-    clippy::restriction,
-    clippy::style,
-    clippy::missing_const_for_fn,
-    clippy::ptr_offset_with_cast,
-    clippy::useless_transmute,
-    clippy::missing_safety_doc
-)]
-
-//! `bindgen`-generated declarations.
-
-#[cfg(MESON)]
-include!("bindings.inc.rs");
-
-#[cfg(not(MESON))]
-include!(concat!(env!("OUT_DIR"), "/bindings.inc.rs"));
-
-// SAFETY: these are implemented in C; the bindings need to assert that the
-// BQL is taken, either directly or via `BqlCell` and `BqlRefCell`.
-// When bindings for character devices are introduced, this can be
-// moved to the Opaque<> wrapper in src/chardev.rs.
-unsafe impl Send for CharFrontend {}
-unsafe impl Sync for CharFrontend {}
-
-// SAFETY: this is a pure data struct
-unsafe impl Send for CoalescedMemoryRange {}
-unsafe impl Sync for CoalescedMemoryRange {}
-
-// SAFETY: these are constants and vtables; the Send and Sync requirements
-// are deferred to the unsafe callbacks that they contain
-unsafe impl Send for MemoryRegionOps {}
-unsafe impl Sync for MemoryRegionOps {}
-
-unsafe impl Send for Property {}
-unsafe impl Sync for Property {}
-
-unsafe impl Send for TypeInfo {}
-unsafe impl Sync for TypeInfo {}
-
-unsafe impl Send for VMStateDescription {}
-unsafe impl Sync for VMStateDescription {}
-
-unsafe impl Send for VMStateField {}
-unsafe impl Sync for VMStateField {}
-
-unsafe impl Send for VMStateInfo {}
-unsafe impl Sync for VMStateInfo {}
-
-// bindgen does not derive Default here
-#[allow(clippy::derivable_impls)]
-impl Default for VMStateFlags {
-    fn default() -> Self {
-        Self(0)
-    }
-}
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/9] rust: remove unused --cfg arguments
  2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
  2025-11-27 13:20 ` [PATCH 1/9] rust: remove leftover bindings/ Paolo Bonzini
@ 2025-11-27 13:20 ` Paolo Bonzini
  2025-12-03 10:25   ` Zhao Liu
  2025-11-27 13:20 ` [PATCH 3/9] rust: remove unnecessary repetitive options Paolo Bonzini
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2025-11-27 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/qemu-macros/meson.build                                 | 5 -----
 subprojects/packagefiles/bilge-impl-0.2-rs/meson.build       | 3 ---
 subprojects/packagefiles/proc-macro-error-1-rs/meson.build   | 1 -
 .../packagefiles/proc-macro-error-attr-1-rs/meson.build      | 3 ---
 4 files changed, 12 deletions(-)

diff --git a/rust/qemu-macros/meson.build b/rust/qemu-macros/meson.build
index 0f27e0df925..17b2a4e2e24 100644
--- a/rust/qemu-macros/meson.build
+++ b/rust/qemu-macros/meson.build
@@ -2,11 +2,6 @@ _qemu_macros_rs = rust.proc_macro(
   'qemu_macros',
   files('src/lib.rs'),
   override_options: ['rust_std=2021', 'build.rust_std=2021'],
-  rust_args: [
-    '--cfg', 'use_fallback',
-    '--cfg', 'feature="syn-error"',
-    '--cfg', 'feature="proc-macro"',
-  ],
   dependencies: [
     attrs_rs_native,
     proc_macro2_rs_native,
diff --git a/subprojects/packagefiles/bilge-impl-0.2-rs/meson.build b/subprojects/packagefiles/bilge-impl-0.2-rs/meson.build
index 42b03dcd53c..04617b875c5 100644
--- a/subprojects/packagefiles/bilge-impl-0.2-rs/meson.build
+++ b/subprojects/packagefiles/bilge-impl-0.2-rs/meson.build
@@ -26,9 +26,6 @@ _bilge_impl_rs = rust.proc_macro(
   override_options: ['rust_std=2021', 'build.rust_std=2021'],
   rust_args: [
     '--cap-lints', 'allow',
-    '--cfg', 'use_fallback',
-    '--cfg', 'feature="syn-error"',
-    '--cfg', 'feature="proc-macro"',
   ],
   dependencies: [
     itertools_dep,
diff --git a/subprojects/packagefiles/proc-macro-error-1-rs/meson.build b/subprojects/packagefiles/proc-macro-error-1-rs/meson.build
index 10c2741085c..8ba558e1330 100644
--- a/subprojects/packagefiles/proc-macro-error-1-rs/meson.build
+++ b/subprojects/packagefiles/proc-macro-error-1-rs/meson.build
@@ -23,7 +23,6 @@ _proc_macro_error_rs = static_library(
     '--cap-lints', 'allow',
     '--cfg', 'use_fallback',
     '--cfg', 'feature="syn-error"',
-    '--cfg', 'feature="proc-macro"',
     '-A', 'non_fmt_panics'
   ],
   dependencies: [
diff --git a/subprojects/packagefiles/proc-macro-error-attr-1-rs/meson.build b/subprojects/packagefiles/proc-macro-error-attr-1-rs/meson.build
index c4c4c5e397c..a85d7c07143 100644
--- a/subprojects/packagefiles/proc-macro-error-attr-1-rs/meson.build
+++ b/subprojects/packagefiles/proc-macro-error-attr-1-rs/meson.build
@@ -17,9 +17,6 @@ _proc_macro_error_attr_rs = rust.proc_macro(
   override_options: ['rust_std=2018', 'build.rust_std=2018'],
   rust_args: [
     '--cap-lints', 'allow',
-    '--cfg', 'use_fallback',
-    '--cfg', 'feature="syn-error"',
-    '--cfg', 'feature="proc-macro"'
   ],
   dependencies: [
     proc_macro2_dep,
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/9] rust: remove unnecessary repetitive options
  2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
  2025-11-27 13:20 ` [PATCH 1/9] rust: remove leftover bindings/ Paolo Bonzini
  2025-11-27 13:20 ` [PATCH 2/9] rust: remove unused --cfg arguments Paolo Bonzini
@ 2025-11-27 13:20 ` Paolo Bonzini
  2025-12-03 10:37   ` Zhao Liu
  2025-11-27 13:20 ` [PATCH 4/9] rust/bql: make bindings public Paolo Bonzini
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2025-11-27 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build                  | 3 ++-
 rust/bits/meson.build        | 2 --
 rust/bql/meson.build         | 2 --
 rust/chardev/meson.build     | 2 --
 rust/common/meson.build      | 2 --
 rust/migration/meson.build   | 2 --
 rust/qemu-macros/meson.build | 1 -
 rust/qom/meson.build         | 2 --
 rust/system/meson.build      | 2 --
 rust/tests/meson.build       | 1 -
 rust/trace/meson.build       | 2 --
 rust/util/meson.build        | 2 --
 12 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/meson.build b/meson.build
index d9293294d8e..270181038bf 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,7 @@
 project('qemu', ['c'], meson_version: '>=1.5.0',
         default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++11', 'b_colorout=auto',
-                          'b_staticpic=false', 'stdsplit=false', 'optimization=2', 'b_pie=true'],
+                          'b_staticpic=false', 'stdsplit=false', 'optimization=2', 'b_pie=true',
+                          'rust_std=2021', 'build.rust_std=2021'],
         version: files('VERSION'))
 
 meson.add_devenv({ 'MESON_BUILD_ROOT' : meson.project_build_root() })
diff --git a/rust/bits/meson.build b/rust/bits/meson.build
index 359ca86f155..c0094ffcf38 100644
--- a/rust/bits/meson.build
+++ b/rust/bits/meson.build
@@ -1,8 +1,6 @@
 _bits_rs = static_library(
   'bits',
   'src/lib.rs',
-  override_options: ['rust_std=2021', 'build.rust_std=2021'],
-  rust_abi: 'rust',
   dependencies: [qemu_macros],
 )
 
diff --git a/rust/bql/meson.build b/rust/bql/meson.build
index 091372dd7b6..e5836e3f566 100644
--- a/rust/bql/meson.build
+++ b/rust/bql/meson.build
@@ -34,8 +34,6 @@ _bql_rs = static_library(
     ],
     {'.': _bql_bindings_inc_rs}
   ),
-  override_options: ['rust_std=2021', 'build.rust_std=2021'],
-  rust_abi: 'rust',
   rust_args: _bql_cfg,
   dependencies: [glib_sys_rs],
 )
diff --git a/rust/chardev/meson.build b/rust/chardev/meson.build
index 36ada7c4546..6b681c609ad 100644
--- a/rust/chardev/meson.build
+++ b/rust/chardev/meson.build
@@ -33,8 +33,6 @@ _chardev_rs = static_library(
     ],
     {'.': _chardev_bindings_inc_rs}
   ),
-  override_options: ['rust_std=2021', 'build.rust_std=2021'],
-  rust_abi: 'rust',
   link_with: [_bql_rs, _migration_rs, _qom_rs, _util_rs],
   dependencies: [glib_sys_rs, common_rs, qemu_macros],
 )
diff --git a/rust/common/meson.build b/rust/common/meson.build
index aff601d1df2..4b1cd35f639 100644
--- a/rust/common/meson.build
+++ b/rust/common/meson.build
@@ -16,8 +16,6 @@ _common_rs = static_library(
       'src/zeroable.rs',
     ],
   ),
-  override_options: ['rust_std=2021', 'build.rust_std=2021'],
-  rust_abi: 'rust',
   rust_args: _common_cfg,
   dependencies: [libc_rs, qemu_macros],
 )
diff --git a/rust/migration/meson.build b/rust/migration/meson.build
index 444494700ad..94590dc1b87 100644
--- a/rust/migration/meson.build
+++ b/rust/migration/meson.build
@@ -36,8 +36,6 @@ _migration_rs = static_library(
     ],
     {'.' : _migration_bindings_inc_rs},
   ),
-  override_options: ['rust_std=2021', 'build.rust_std=2021'],
-  rust_abi: 'rust',
   link_with: [_util_rs, _bql_rs],
   dependencies: [common_rs, glib_sys_rs, qemu_macros],
 )
diff --git a/rust/qemu-macros/meson.build b/rust/qemu-macros/meson.build
index 17b2a4e2e24..cdea5bf439e 100644
--- a/rust/qemu-macros/meson.build
+++ b/rust/qemu-macros/meson.build
@@ -1,7 +1,6 @@
 _qemu_macros_rs = rust.proc_macro(
   'qemu_macros',
   files('src/lib.rs'),
-  override_options: ['rust_std=2021', 'build.rust_std=2021'],
   dependencies: [
     attrs_rs_native,
     proc_macro2_rs_native,
diff --git a/rust/qom/meson.build b/rust/qom/meson.build
index e50f41858d6..551c4f0bf5f 100644
--- a/rust/qom/meson.build
+++ b/rust/qom/meson.build
@@ -26,8 +26,6 @@ _qom_rs = static_library(
     ],
     {'.': _qom_bindings_inc_rs}
   ),
-  override_options: ['rust_std=2021', 'build.rust_std=2021'],
-  rust_abi: 'rust',
   link_with: [_bql_rs, _migration_rs],
   dependencies: [common_rs, glib_sys_rs, qemu_macros],
 )
diff --git a/rust/system/meson.build b/rust/system/meson.build
index 73d61991146..2cd2dd36679 100644
--- a/rust/system/meson.build
+++ b/rust/system/meson.build
@@ -33,8 +33,6 @@ _system_rs = static_library(
     ],
     {'.': _system_bindings_inc_rs}
   ),
-  override_options: ['rust_std=2021', 'build.rust_std=2021'],
-  rust_abi: 'rust',
   link_with: [_bql_rs, _migration_rs, _qom_rs, _util_rs],
   dependencies: [glib_sys_rs, common_rs, qemu_macros],
 )
diff --git a/rust/tests/meson.build b/rust/tests/meson.build
index 00688c66fb1..3c5020490b0 100644
--- a/rust/tests/meson.build
+++ b/rust/tests/meson.build
@@ -2,7 +2,6 @@ test('rust-integration',
     executable(
         'rust-integration',
         files('tests/vmstate_tests.rs'),
-        override_options: ['rust_std=2021', 'build.rust_std=2021'],
         rust_args: ['--test'],
         install: false,
         dependencies: [bql_rs, common_rs, util_rs, migration_rs, qom_rs]),
diff --git a/rust/trace/meson.build b/rust/trace/meson.build
index adca57e5507..1b3498f7fc1 100644
--- a/rust/trace/meson.build
+++ b/rust/trace/meson.build
@@ -11,9 +11,7 @@ _trace_rs = static_library(
   'trace',             # Library name,
   lib_rs,
   trace_rs_targets,         # List of generated `.rs` custom targets
-  override_options: ['rust_std=2021', 'build.rust_std=2021'],
   dependencies: [libc_rs],
-  rust_abi: 'rust',
 )
 
 trace_rs = declare_dependency(link_with: _trace_rs)
diff --git a/rust/util/meson.build b/rust/util/meson.build
index 8ad344dccbd..18d67a4b374 100644
--- a/rust/util/meson.build
+++ b/rust/util/meson.build
@@ -38,8 +38,6 @@ _util_rs = static_library(
     ],
     {'.': _util_bindings_inc_rs}
   ),
-  override_options: ['rust_std=2021', 'build.rust_std=2021'],
-  rust_abi: 'rust',
   dependencies: [anyhow_rs, libc_rs, foreign_rs, glib_sys_rs, common_rs, qom, qemuutil],
 )
 
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/9] rust/bql: make bindings public
  2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
                   ` (2 preceding siblings ...)
  2025-11-27 13:20 ` [PATCH 3/9] rust: remove unnecessary repetitive options Paolo Bonzini
@ 2025-11-27 13:20 ` Paolo Bonzini
  2025-12-03 10:58   ` Zhao Liu
  2025-11-27 13:20 ` [PATCH 5/9] rust: do not copy the SysBusDevice Paolo Bonzini
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2025-11-27 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

For consistency with other crates.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/bql/src/lib.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/bql/src/lib.rs b/rust/bql/src/lib.rs
index ef08221e9c1..2cdc551e21e 100644
--- a/rust/bql/src/lib.rs
+++ b/rust/bql/src/lib.rs
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
-mod bindings;
+pub mod bindings;
 use bindings::{bql_block_unlock, bql_locked, rust_bql_mock_lock};
 
 mod cell;
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 5/9] rust: do not copy the SysBusDevice
  2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
                   ` (3 preceding siblings ...)
  2025-11-27 13:20 ` [PATCH 4/9] rust/bql: make bindings public Paolo Bonzini
@ 2025-11-27 13:20 ` Paolo Bonzini
  2025-12-03 10:59   ` Zhao Liu
  2025-11-27 13:20 ` [PATCH 6/9] rust: fix reference to MemoryRegion Paolo Bonzini
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2025-11-27 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/hw/core/src/sysbus.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/hw/core/src/sysbus.rs b/rust/hw/core/src/sysbus.rs
index 68165e89295..ec620639be5 100644
--- a/rust/hw/core/src/sysbus.rs
+++ b/rust/hw/core/src/sysbus.rs
@@ -78,7 +78,7 @@ fn mmio_addr(&self, id: u32) -> Option<u64> {
         assert!(bql::is_locked());
         // SAFETY: the BQL ensures that no one else writes to sbd.mmio[], and
         // the SysBusDevice must be initialized to get an IsA<SysBusDevice>.
-        let sbd = unsafe { *self.upcast().as_ptr() };
+        let sbd = unsafe { &*self.upcast().as_ptr() };
         let id: usize = id.try_into().unwrap();
         if sbd.mmio[id].memory.is_null() {
             None
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 6/9] rust: fix reference to MemoryRegion
  2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
                   ` (4 preceding siblings ...)
  2025-11-27 13:20 ` [PATCH 5/9] rust: do not copy the SysBusDevice Paolo Bonzini
@ 2025-11-27 13:20 ` Paolo Bonzini
  2025-12-03 11:00   ` Zhao Liu
  2025-11-27 13:20 ` [PATCH 7/9] rust: move strict lints handling to meson.build Paolo Bonzini
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2025-11-27 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

Use the wrapper struct, not the C one.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/bql/src/cell.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/bql/src/cell.rs b/rust/bql/src/cell.rs
index 8ade7db629c..435d6663ac4 100644
--- a/rust/bql/src/cell.rs
+++ b/rust/bql/src/cell.rs
@@ -42,7 +42,7 @@
 //! references to an object and yet mutate it. In particular, QEMU objects
 //! usually have their pointer shared with the "outside world very early in
 //! their lifetime", for example when they create their
-//! [`MemoryRegion`s](crate::bindings::MemoryRegion).  Therefore, individual
+//! [`MemoryRegion`s](system::MemoryRegion).  Therefore, individual
 //! parts of a  device must be made mutable in a controlled manner; this module
 //! provides the tools to do so.
 //!
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 7/9] rust: move strict lints handling to meson.build
  2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
                   ` (5 preceding siblings ...)
  2025-11-27 13:20 ` [PATCH 6/9] rust: fix reference to MemoryRegion Paolo Bonzini
@ 2025-11-27 13:20 ` Paolo Bonzini
  2025-12-03 15:29   ` Zhao Liu
  2025-11-27 13:20 ` [PATCH 8/9] rust: Do not link qemuutil into Rust rlibs Paolo Bonzini
  2025-11-27 13:20 ` [PATCH 9/9] rust: only link the Rust part of the code into devices Paolo Bonzini
  8 siblings, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2025-11-27 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

Simplify rustc_args.py, and align its code with what Meson's own Cargo.toml
translator does in v1.10.

Bump unknown_lints to "forbid", so that it will certainly override Cargo.toml's
"allow" level.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build                |  7 +++----
 scripts/rust/rustc_args.py | 20 ++------------------
 2 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/meson.build b/meson.build
index 270181038bf..e6a11cefdb7 100644
--- a/meson.build
+++ b/meson.build
@@ -128,14 +128,13 @@ if have_rust
   rustc_args = [find_program('scripts/rust/rustc_args.py'),
     '--rustc-version', rustc.version(),
     '--workspace', meson.project_source_root() / 'rust']
-  if get_option('strict_rust_lints')
-    rustc_args += ['--strict-lints']
-  endif
-
   rustfmt = find_program('rustfmt', required: false)
 
   rustc_lint_args = run_command(rustc_args, '--lints',
      capture: true, check: true).stdout().strip().splitlines()
+  if get_option('strict_rust_lints')
+    rustc_lint_args += ['-Dwarnings', '-Funknown_lints']
+  endif
 
   # Apart from procedural macros, our Rust executables will often link
   # with C code, so include all the libraries that C code needs.  This
diff --git a/scripts/rust/rustc_args.py b/scripts/rust/rustc_args.py
index 63b0748e0d3..8fb77785350 100644
--- a/scripts/rust/rustc_args.py
+++ b/scripts/rust/rustc_args.py
@@ -35,8 +35,6 @@
 except ImportError:
     import tomli as tomllib
 
-STRICT_LINTS = {"unknown_lints", "warnings"}
-
 
 class CargoTOML:
     tomldata: Mapping[Any, Any]
@@ -82,7 +80,7 @@ class LintFlag:
     priority: int
 
 
-def generate_lint_flags(cargo_toml: CargoTOML, strict_lints: bool) -> Iterable[str]:
+def generate_lint_flags(cargo_toml: CargoTOML) -> Iterable[str]:
     """Converts Cargo.toml lints to rustc -A/-D/-F/-W flags."""
 
     toml_lints = cargo_toml.lints
@@ -104,13 +102,6 @@ def generate_lint_flags(cargo_toml: CargoTOML, strict_lints: bool) -> Iterable[s
             else:
                 raise Exception(f"invalid level {level} for {prefix}{lint}")
 
-            if not (strict_lints and lint in STRICT_LINTS):
-                lint_list.append(LintFlag(flags=[flag, prefix + lint], priority=priority))
-
-    if strict_lints:
-        for lint in STRICT_LINTS:
-            lint_list.append(LintFlag(flags=["-D", lint], priority=1000000))
-
     lint_list.sort(key=lambda x: x.priority)
     for lint in lint_list:
         yield from lint.flags
@@ -187,13 +178,6 @@ def main() -> None:
         required=False,
         default="1.0.0",
     )
-    parser.add_argument(
-        "--strict-lints",
-        action="store_true",
-        dest="strict_lints",
-        help="apply stricter checks (for nightly Rust)",
-        default=False,
-    )
     args = parser.parse_args()
     if args.verbose:
         logging.basicConfig(level=logging.DEBUG)
@@ -207,7 +191,7 @@ def main() -> None:
         cargo_toml = CargoTOML(args.cargo_toml, None)
 
     if args.lints:
-        for tok in generate_lint_flags(cargo_toml, args.strict_lints):
+        for tok in generate_lint_flags(cargo_toml):
             print(tok)
 
     if rustc_version >= (1, 80):
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 8/9] rust: Do not link qemuutil into Rust rlibs
  2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
                   ` (6 preceding siblings ...)
  2025-11-27 13:20 ` [PATCH 7/9] rust: move strict lints handling to meson.build Paolo Bonzini
@ 2025-11-27 13:20 ` Paolo Bonzini
  2025-11-27 13:20 ` [PATCH 9/9] rust: only link the Rust part of the code into devices Paolo Bonzini
  8 siblings, 0 replies; 18+ messages in thread
From: Paolo Bonzini @ 2025-11-27 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust, Martin Kletzander

From: Martin Kletzander <mkletzan@redhat.com>

Commit de037ab8d83d removed qemuutil dependency from chardev and util
rust crates.  However it stayed in the _util_rs static library.  The
dependency is also defined as `link_with`, which is fine for C targets,
where the resulting archive gets linked as another parameter on the
command line when it is a static library.

However, when a C library is linked into a Rust rlib, rustc remembers
the dependency into the metadata and adds the library to the linker
command line.

Unfortunately, static libraries are sensitive to their
position on the command line and rustc does not always get it right.
Fortunately, simply removing it from dependencies of any rust libraries
and instead adding them into the dependencies of executables and
doctests fixes the behaviour.

Without this patch the error I get is:

  FAILED: [code=1] rust/tests/rust-integration
  ...
  = note: rust-lld: error: unable to find library -l:libqemuutil.a
          rust-lld: error: unable to find library -l:libvhost-user-glib.a
          rust-lld: error: unable to find library -l:libvhost-user.a
          rust-lld: error: unable to find library -l:libqemuutil.a
          rust-lld: error: unable to find library -l:libvhost-user-glib.a
          rust-lld: error: unable to find library -l:libvhost-user.a
          rust-lld: error: unable to find library -l:libqemuutil.a
          rust-lld: error: unable to find library -l:libvhost-user-glib.a
          rust-lld: error: unable to find library -l:libvhost-user.a
          rust-lld: error: unable to find library -l:libqemuutil.a
          rust-lld: error: unable to find library -l:libvhost-user-glib.a
          rust-lld: error: unable to find library -l:libvhost-user.a
          rust-lld: error: unable to find library -l:libqemuutil.a
          rust-lld: error: unable to find library -l:libvhost-user-glib.a
          rust-lld: error: unable to find library -l:libvhost-user.a
          rust-lld: error: unable to find library -l:libqemuutil.a
          rust-lld: error: unable to find library -l:libvhost-user-glib.a
          rust-lld: error: unable to find library -l:libvhost-user.a
          collect2: error: ld returned 1 exit status

Meson could work around it itself by never adding these static libraries
to the rlibs (after all, Meson tracks the transitive dependencies already
and knows how to add them to dependents of those rlibs); at least for now,
do it in QEMU: never link C libraries into Rust rlibs, and add them to the
final build products only.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/chardev/meson.build | 2 +-
 rust/qom/meson.build     | 2 +-
 rust/util/meson.build    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/rust/chardev/meson.build b/rust/chardev/meson.build
index 6b681c609ad..204977ca47c 100644
--- a/rust/chardev/meson.build
+++ b/rust/chardev/meson.build
@@ -37,4 +37,4 @@ _chardev_rs = static_library(
   dependencies: [glib_sys_rs, common_rs, qemu_macros],
 )
 
-chardev_rs = declare_dependency(link_with: [_chardev_rs], dependencies: [chardev])
+chardev_rs = declare_dependency(link_with: [_chardev_rs], dependencies: [chardev, qemuutil])
diff --git a/rust/qom/meson.build b/rust/qom/meson.build
index 551c4f0bf5f..dda26c3f981 100644
--- a/rust/qom/meson.build
+++ b/rust/qom/meson.build
@@ -30,7 +30,7 @@ _qom_rs = static_library(
   dependencies: [common_rs, glib_sys_rs, qemu_macros],
 )
 
-qom_rs = declare_dependency(link_with: [_qom_rs], dependencies: [qemu_macros, qom])
+qom_rs = declare_dependency(link_with: [_qom_rs], dependencies: [qemu_macros, qom, qemuutil])
 
 # Doctests are essentially integration tests, so they need the same dependencies.
 # Note that running them requires the object files for C code, so place them
diff --git a/rust/util/meson.build b/rust/util/meson.build
index 18d67a4b374..95aa211ef0b 100644
--- a/rust/util/meson.build
+++ b/rust/util/meson.build
@@ -38,10 +38,10 @@ _util_rs = static_library(
     ],
     {'.': _util_bindings_inc_rs}
   ),
-  dependencies: [anyhow_rs, libc_rs, foreign_rs, glib_sys_rs, common_rs, qom, qemuutil],
+  dependencies: [anyhow_rs, libc_rs, foreign_rs, glib_sys_rs, common_rs],
 )
 
-util_rs = declare_dependency(link_with: [_util_rs])
+util_rs = declare_dependency(link_with: [_util_rs], dependencies: [qemuutil, qom])
 
 rust.test('rust-util-tests', _util_rs,
           dependencies: [qemuutil, qom],
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 9/9] rust: only link the Rust part of the code into devices
  2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
                   ` (7 preceding siblings ...)
  2025-11-27 13:20 ` [PATCH 8/9] rust: Do not link qemuutil into Rust rlibs Paolo Bonzini
@ 2025-11-27 13:20 ` Paolo Bonzini
  2025-12-03  9:32   ` Paolo Bonzini
  8 siblings, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2025-11-27 13:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

Do not include libqemuutil in the device crates for the same
reason as in the previous commit.  Static libraries like qemuutil
are sensitive to their position on the command line and rustc does not
always get it right.

If rustc places the library too early on the command line, the stubs
are included in the final link product, which results in duplicate
symbols.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/hw/char/pl011/meson.build | 18 ++++++++++--------
 rust/hw/timer/hpet/meson.build | 16 ++++++++--------
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/rust/hw/char/pl011/meson.build b/rust/hw/char/pl011/meson.build
index 33b91f21911..9c0e8290e9a 100644
--- a/rust/hw/char/pl011/meson.build
+++ b/rust/hw/char/pl011/meson.build
@@ -28,20 +28,22 @@ _libpl011_rs = static_library(
   ),
   override_options: ['rust_std=2021', 'build.rust_std=2021'],
   rust_abi: 'rust',
+  link_with: [
+    _util_rs,
+    _migration_rs,
+    _bql_rs,
+    _qom_rs,
+    _chardev_rs,
+    _system_rs,
+    _hwcore_rs,
+    _trace_rs
+  ],
   dependencies: [
     bilge_rs,
     bilge_impl_rs,
     bits_rs,
     common_rs,
     glib_sys_rs,
-    util_rs,
-    migration_rs,
-    bql_rs,
-    qom_rs,
-    chardev_rs,
-    system_rs,
-    hwcore_rs,
-    trace_rs
   ],
 )
 
diff --git a/rust/hw/timer/hpet/meson.build b/rust/hw/timer/hpet/meson.build
index bb64b96672e..7eb758ae347 100644
--- a/rust/hw/timer/hpet/meson.build
+++ b/rust/hw/timer/hpet/meson.build
@@ -3,15 +3,15 @@ _libhpet_rs = static_library(
   files('src/lib.rs'),
   override_options: ['rust_std=2021', 'build.rust_std=2021'],
   rust_abi: 'rust',
-  dependencies: [
-    common_rs,
-    util_rs,
-    migration_rs,
-    bql_rs,
-    qom_rs,
-    system_rs,
-    hwcore_rs,
+  link_with: [
+    _util_rs,
+    _migration_rs,
+    _bql_rs,
+    _qom_rs,
+    _system_rs,
+    _hwcore_rs,
   ],
+  dependencies: [common_rs],
 )
 
 rust_devices_ss.add(when: 'CONFIG_X_HPET_RUST', if_true: [declare_dependency(
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/9] rust: remove leftover bindings/
  2025-11-27 13:20 ` [PATCH 1/9] rust: remove leftover bindings/ Paolo Bonzini
@ 2025-12-03  9:11   ` Zhao Liu
  0 siblings, 0 replies; 18+ messages in thread
From: Zhao Liu @ 2025-12-03  9:11 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-rust, Marc-André Lureau

On Thu, Nov 27, 2025 at 02:20:28PM +0100, Paolo Bonzini wrote:
> Date: Thu, 27 Nov 2025 14:20:28 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 1/9] rust: remove leftover bindings/
> X-Mailer: git-send-email 2.51.1
> 
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  rust/bindings/src/lib.rs | 64 ----------------------------------------
>  1 file changed, 64 deletions(-)
>  delete mode 100644 rust/bindings/src/lib.rs

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 9/9] rust: only link the Rust part of the code into devices
  2025-11-27 13:20 ` [PATCH 9/9] rust: only link the Rust part of the code into devices Paolo Bonzini
@ 2025-12-03  9:32   ` Paolo Bonzini
  0 siblings, 0 replies; 18+ messages in thread
From: Paolo Bonzini @ 2025-12-03  9:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: open list:Rust-related patc...

[-- Attachment #1: Type: text/plain, Size: 2426 bytes --]

Turns out these last two patches only work with unreleased Meson. I will
put everything into a testable series once 1.10 is out (should be soon,
it's already at rc2).

Paolo

Il gio 27 nov 2025, 14:20 Paolo Bonzini <pbonzini@redhat.com> ha scritto:

> Do not include libqemuutil in the device crates for the same
> reason as in the previous commit.  Static libraries like qemuutil
> are sensitive to their position on the command line and rustc does not
> always get it right.
>
> If rustc places the library too early on the command line, the stubs
> are included in the final link product, which results in duplicate
> symbols.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/hw/char/pl011/meson.build | 18 ++++++++++--------
>  rust/hw/timer/hpet/meson.build | 16 ++++++++--------
>  2 files changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/rust/hw/char/pl011/meson.build
> b/rust/hw/char/pl011/meson.build
> index 33b91f21911..9c0e8290e9a 100644
> --- a/rust/hw/char/pl011/meson.build
> +++ b/rust/hw/char/pl011/meson.build
> @@ -28,20 +28,22 @@ _libpl011_rs = static_library(
>    ),
>    override_options: ['rust_std=2021', 'build.rust_std=2021'],
>    rust_abi: 'rust',
> +  link_with: [
> +    _util_rs,
> +    _migration_rs,
> +    _bql_rs,
> +    _qom_rs,
> +    _chardev_rs,
> +    _system_rs,
> +    _hwcore_rs,
> +    _trace_rs
> +  ],
>    dependencies: [
>      bilge_rs,
>      bilge_impl_rs,
>      bits_rs,
>      common_rs,
>      glib_sys_rs,
> -    util_rs,
> -    migration_rs,
> -    bql_rs,
> -    qom_rs,
> -    chardev_rs,
> -    system_rs,
> -    hwcore_rs,
> -    trace_rs
>    ],
>  )
>
> diff --git a/rust/hw/timer/hpet/meson.build
> b/rust/hw/timer/hpet/meson.build
> index bb64b96672e..7eb758ae347 100644
> --- a/rust/hw/timer/hpet/meson.build
> +++ b/rust/hw/timer/hpet/meson.build
> @@ -3,15 +3,15 @@ _libhpet_rs = static_library(
>    files('src/lib.rs'),
>    override_options: ['rust_std=2021', 'build.rust_std=2021'],
>    rust_abi: 'rust',
> -  dependencies: [
> -    common_rs,
> -    util_rs,
> -    migration_rs,
> -    bql_rs,
> -    qom_rs,
> -    system_rs,
> -    hwcore_rs,
> +  link_with: [
> +    _util_rs,
> +    _migration_rs,
> +    _bql_rs,
> +    _qom_rs,
> +    _system_rs,
> +    _hwcore_rs,
>    ],
> +  dependencies: [common_rs],
>  )
>
>  rust_devices_ss.add(when: 'CONFIG_X_HPET_RUST', if_true:
> [declare_dependency(
> --
> 2.51.1
>

[-- Attachment #2: Type: text/html, Size: 3335 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/9] rust: remove unused --cfg arguments
  2025-11-27 13:20 ` [PATCH 2/9] rust: remove unused --cfg arguments Paolo Bonzini
@ 2025-12-03 10:25   ` Zhao Liu
  0 siblings, 0 replies; 18+ messages in thread
From: Zhao Liu @ 2025-12-03 10:25 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-rust

On Thu, Nov 27, 2025 at 02:20:29PM +0100, Paolo Bonzini wrote:
> Date: Thu, 27 Nov 2025 14:20:29 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 2/9] rust: remove unused --cfg arguments
> X-Mailer: git-send-email 2.51.1
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/qemu-macros/meson.build                                 | 5 -----
>  subprojects/packagefiles/bilge-impl-0.2-rs/meson.build       | 3 ---
>  subprojects/packagefiles/proc-macro-error-1-rs/meson.build   | 1 -
>  .../packagefiles/proc-macro-error-attr-1-rs/meson.build      | 3 ---
>  4 files changed, 12 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/9] rust: remove unnecessary repetitive options
  2025-11-27 13:20 ` [PATCH 3/9] rust: remove unnecessary repetitive options Paolo Bonzini
@ 2025-12-03 10:37   ` Zhao Liu
  0 siblings, 0 replies; 18+ messages in thread
From: Zhao Liu @ 2025-12-03 10:37 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-rust

On Thu, Nov 27, 2025 at 02:20:30PM +0100, Paolo Bonzini wrote:
> Date: Thu, 27 Nov 2025 14:20:30 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 3/9] rust: remove unnecessary repetitive options
> X-Mailer: git-send-email 2.51.1
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  meson.build                  | 3 ++-
>  rust/bits/meson.build        | 2 --
>  rust/bql/meson.build         | 2 --
>  rust/chardev/meson.build     | 2 --
>  rust/common/meson.build      | 2 --
>  rust/migration/meson.build   | 2 --
>  rust/qemu-macros/meson.build | 1 -
>  rust/qom/meson.build         | 2 --
>  rust/system/meson.build      | 2 --
>  rust/tests/meson.build       | 1 -
>  rust/trace/meson.build       | 2 --
>  rust/util/meson.build        | 2 --
>  12 files changed, 2 insertions(+), 21 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/9] rust/bql: make bindings public
  2025-11-27 13:20 ` [PATCH 4/9] rust/bql: make bindings public Paolo Bonzini
@ 2025-12-03 10:58   ` Zhao Liu
  0 siblings, 0 replies; 18+ messages in thread
From: Zhao Liu @ 2025-12-03 10:58 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-rust

On Thu, Nov 27, 2025 at 02:20:31PM +0100, Paolo Bonzini wrote:
> Date: Thu, 27 Nov 2025 14:20:31 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 4/9] rust/bql: make bindings public
> X-Mailer: git-send-email 2.51.1
> 
> For consistency with other crates.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/bql/src/lib.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Other crates appear to require being public mods to ensure binding
compilation succeeds or to use raw binding in somewhere, but currently
bql's raw binding hasn't been used anywhere.

I think maybe it's better to keep this mod as private until someone
needs it. This helps justify whether raw binding is truly necessary.
Direct binding uses should be minimized if possible.

Thanks,
Zhao



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 5/9] rust: do not copy the SysBusDevice
  2025-11-27 13:20 ` [PATCH 5/9] rust: do not copy the SysBusDevice Paolo Bonzini
@ 2025-12-03 10:59   ` Zhao Liu
  0 siblings, 0 replies; 18+ messages in thread
From: Zhao Liu @ 2025-12-03 10:59 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-rust

On Thu, Nov 27, 2025 at 02:20:32PM +0100, Paolo Bonzini wrote:
> Date: Thu, 27 Nov 2025 14:20:32 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 5/9] rust: do not copy the SysBusDevice
> X-Mailer: git-send-email 2.51.1
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/hw/core/src/sysbus.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 6/9] rust: fix reference to MemoryRegion
  2025-11-27 13:20 ` [PATCH 6/9] rust: fix reference to MemoryRegion Paolo Bonzini
@ 2025-12-03 11:00   ` Zhao Liu
  0 siblings, 0 replies; 18+ messages in thread
From: Zhao Liu @ 2025-12-03 11:00 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-rust

On Thu, Nov 27, 2025 at 02:20:33PM +0100, Paolo Bonzini wrote:
> Date: Thu, 27 Nov 2025 14:20:33 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 6/9] rust: fix reference to MemoryRegion
> X-Mailer: git-send-email 2.51.1
> 
> Use the wrapper struct, not the C one.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/bql/src/cell.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 7/9] rust: move strict lints handling to meson.build
  2025-11-27 13:20 ` [PATCH 7/9] rust: move strict lints handling to meson.build Paolo Bonzini
@ 2025-12-03 15:29   ` Zhao Liu
  0 siblings, 0 replies; 18+ messages in thread
From: Zhao Liu @ 2025-12-03 15:29 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-rust

On Thu, Nov 27, 2025 at 02:20:34PM +0100, Paolo Bonzini wrote:
> Date: Thu, 27 Nov 2025 14:20:34 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 7/9] rust: move strict lints handling to meson.build
> X-Mailer: git-send-email 2.51.1
> 
> Simplify rustc_args.py, and align its code with what Meson's own Cargo.toml
> translator does in v1.10.
> 
> Bump unknown_lints to "forbid", so that it will certainly override Cargo.toml's
> "allow" level.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  meson.build                |  7 +++----
>  scripts/rust/rustc_args.py | 20 ++------------------
>  2 files changed, 5 insertions(+), 22 deletions(-)

After simplification, it has become more readable.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-12-03 15:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
2025-11-27 13:20 ` [PATCH 1/9] rust: remove leftover bindings/ Paolo Bonzini
2025-12-03  9:11   ` Zhao Liu
2025-11-27 13:20 ` [PATCH 2/9] rust: remove unused --cfg arguments Paolo Bonzini
2025-12-03 10:25   ` Zhao Liu
2025-11-27 13:20 ` [PATCH 3/9] rust: remove unnecessary repetitive options Paolo Bonzini
2025-12-03 10:37   ` Zhao Liu
2025-11-27 13:20 ` [PATCH 4/9] rust/bql: make bindings public Paolo Bonzini
2025-12-03 10:58   ` Zhao Liu
2025-11-27 13:20 ` [PATCH 5/9] rust: do not copy the SysBusDevice Paolo Bonzini
2025-12-03 10:59   ` Zhao Liu
2025-11-27 13:20 ` [PATCH 6/9] rust: fix reference to MemoryRegion Paolo Bonzini
2025-12-03 11:00   ` Zhao Liu
2025-11-27 13:20 ` [PATCH 7/9] rust: move strict lints handling to meson.build Paolo Bonzini
2025-12-03 15:29   ` Zhao Liu
2025-11-27 13:20 ` [PATCH 8/9] rust: Do not link qemuutil into Rust rlibs Paolo Bonzini
2025-11-27 13:20 ` [PATCH 9/9] rust: only link the Rust part of the code into devices Paolo Bonzini
2025-12-03  9:32   ` 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).