Re: [PATCH] rust: Update Cargo.lock
Zhao Liu <[email protected]> Wed, 11 Mar 2026 17:11:15 +0800
| Newsgroups | org.nongnu.qemu-rust,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Mar 09, 2026 at 06:24:40PM +0100, Philippe Mathieu-Daudé wrote: > Date: Mon, 9 Mar 2026 18:24:40 +0100 > From: Philippe Mathieu-Daudé <[email protected]> > Subject: [PATCH] rust: Update Cargo.lock > X-Mailer: git-send-email 2.53.0 > > Update Cargo.lock on top of commit 7ecd3f71079 ("Merge tag > 'for-upstream' of https://gitlab.com/bonzini/qemu into staging"). > > Signed-off-by: Philippe Mathieu-Daudé <[email protected]> > --- > rust/Cargo.lock | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) When I ran `cargo +nightly build`, I met this error: $ cargo +nightly build Compiling system-sys v0.1.0 (/media/liuzhao/data/qemu-cook/rust/bindings/system-sys) error[E0432]: unresolved import `hwcore_sys` --> bindings/system-sys/lib.rs:22:5 | 22 | use hwcore_sys::{qemu_irq, DeviceClass, DeviceState}; | ^^^^^^^^^^ use of unresolved module or unlinked crate `hwcore_sys` | = help: if you wanted to use a crate named `hwcore_sys`, use `cargo add hwcore_sys` to add it to your `Cargo.toml` For more information about this error, try `rustc --explain E0432`. error: could not compile `system-sys` (lib) due to 1 previous error This is because of the wrong dependency relationship in Cargo.toml of hwcore-sys & system-sys. But the fix for this error will bring a little more change in Cargo.lock (since the dependencies will change). What about fixing this build bug first before updating Cargo.lock? (That's a fix for build error I met.) -------------------------------->8------------------------------- From cc96c5530f5fe75eb0a422b092dbb761547e7514 Mon Sep 17 00:00:00 2001 From: Zhao Liu <[email protected]> Date: Wed, 11 Mar 2026 17:00:51 +0800 Subject: [PATCH] rust: Fix wrong dependencies for cargo There's a build error: $ cargo +nightly build Compiling system-sys v0.1.0 (/media/liuzhao/data/qemu-cook/rust/bindings/system-sys) error[E0432]: unresolved import `hwcore_sys` --> bindings/system-sys/lib.rs:22:5 | 22 | use hwcore_sys::{qemu_irq, DeviceClass, DeviceState}; | ^^^^^^^^^^ use of unresolved module or unlinked crate `hwcore_sys` | = help: if you wanted to use a crate named `hwcore_sys`, use `cargo add hwcore_sys` to add it to your `Cargo.toml` For more information about this error, try `rustc --explain E0432`. error: could not compile `system-sys` (lib) due to 1 previous error This is because hwcore-sys & system-sys have the wrong dependencies relationship in their Cargo.toml. Fix the dependencies of hwcore-sys & system-sys in Cargo.toml, aligning the dependencies described in their meson.build files. Fixes: commit c899071b5a86 ("rust: move binding generation to bindings/") Signed-off-by: Zhao Liu <[email protected]> --- rust/bindings/hwcore-sys/Cargo.toml | 1 - rust/bindings/system-sys/Cargo.toml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/bindings/hwcore-sys/Cargo.toml b/rust/bindings/hwcore-sys/Cargo.toml index c20024e921a1..b5ae33da8ed6 100644 --- a/rust/bindings/hwcore-sys/Cargo.toml +++ b/rust/bindings/hwcore-sys/Cargo.toml @@ -21,7 +21,6 @@ chardev-sys = { path = "../chardev-sys" } qom-sys = { path = "../qom-sys" } migration-sys = { path = "../migration-sys" } util-sys = { path = "../util-sys" } -system-sys = { path = "../system-sys" } [lints] workspace = true diff --git a/rust/bindings/system-sys/Cargo.toml b/rust/bindings/system-sys/Cargo.toml index 7e527130ff5d..bbb4eaa53db3 100644 --- a/rust/bindings/system-sys/Cargo.toml +++ b/rust/bindings/system-sys/Cargo.toml @@ -17,6 +17,7 @@ path = "lib.rs" [dependencies] glib-sys = { workspace = true } common = { path = "../../common" } +hwcore-sys = { path = "../hwcore-sys" } migration-sys = { path = "../migration-sys" } util-sys = { path = "../util-sys" } qom-sys = { path = "../qom-sys" } -- 2.34.1