[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/40] rust: create a cargo workspace
From: |
Paolo Bonzini |
Subject: |
[PULL 31/40] rust: create a cargo workspace |
Date: |
Mon, 4 Nov 2024 18:27:10 +0100 |
Workspaces allows tracking dependencies for multiple crates at once,
by having a single Cargo.lock file at the top of the rust/ tree.
Because QEMU's Cargo.lock files have to be synchronized with the versions
of crates in subprojects/, using a workspace avoids the need to copy
over the Cargo.lock file when adding a new device (and thus a new crate)
under rust/hw/.
In addition, workspaces let cargo download and build dependencies just
once. While right now we have one leaf crate (hw/char/pl011), this
will not be the case once more devices are added.
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/{hw/char/pl011 => }/Cargo.lock | 0
rust/Cargo.toml | 7 ++++
rust/hw/char/pl011/Cargo.toml | 3 --
rust/qemu-api-macros/Cargo.lock | 47 -------------------------
rust/qemu-api-macros/Cargo.toml | 3 --
rust/qemu-api/Cargo.lock | 54 -----------------------------
rust/qemu-api/Cargo.toml | 3 --
7 files changed, 7 insertions(+), 110 deletions(-)
rename rust/{hw/char/pl011 => }/Cargo.lock (100%)
create mode 100644 rust/Cargo.toml
delete mode 100644 rust/qemu-api-macros/Cargo.lock
delete mode 100644 rust/qemu-api/Cargo.lock
diff --git a/rust/hw/char/pl011/Cargo.lock b/rust/Cargo.lock
similarity index 100%
rename from rust/hw/char/pl011/Cargo.lock
rename to rust/Cargo.lock
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
new file mode 100644
index 00000000000..0c94d5037da
--- /dev/null
+++ b/rust/Cargo.toml
@@ -0,0 +1,7 @@
+[workspace]
+resolver = "2"
+members = [
+ "qemu-api-macros",
+ "qemu-api",
+ "hw/char/pl011",
+]
diff --git a/rust/hw/char/pl011/Cargo.toml b/rust/hw/char/pl011/Cargo.toml
index b089e3dded6..a373906b9fb 100644
--- a/rust/hw/char/pl011/Cargo.toml
+++ b/rust/hw/char/pl011/Cargo.toml
@@ -21,6 +21,3 @@ bilge = { version = "0.2.0" }
bilge-impl = { version = "0.2.0" }
qemu_api = { path = "../../../qemu-api" }
qemu_api_macros = { path = "../../../qemu-api-macros" }
-
-# Do not include in any global workspace
-[workspace]
diff --git a/rust/qemu-api-macros/Cargo.lock b/rust/qemu-api-macros/Cargo.lock
deleted file mode 100644
index 73c334e7ce9..00000000000
--- a/rust/qemu-api-macros/Cargo.lock
+++ /dev/null
@@ -1,47 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.84"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "qemu_api_macros"
-version = "0.1.0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "syn"
-version = "2.0.66"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
diff --git a/rust/qemu-api-macros/Cargo.toml b/rust/qemu-api-macros/Cargo.toml
index 144cc3650fa..f8d6d03609f 100644
--- a/rust/qemu-api-macros/Cargo.toml
+++ b/rust/qemu-api-macros/Cargo.toml
@@ -20,6 +20,3 @@ proc-macro = true
proc-macro2 = "1"
quote = "1"
syn = "2"
-
-# Do not include in any global workspace
-[workspace]
diff --git a/rust/qemu-api/Cargo.lock b/rust/qemu-api/Cargo.lock
deleted file mode 100644
index e407911cdd1..00000000000
--- a/rust/qemu-api/Cargo.lock
+++ /dev/null
@@ -1,54 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.84"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "qemu_api"
-version = "0.1.0"
-dependencies = [
- "qemu_api_macros",
-]
-
-[[package]]
-name = "qemu_api_macros"
-version = "0.1.0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "syn"
-version = "2.0.66"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
diff --git a/rust/qemu-api/Cargo.toml b/rust/qemu-api/Cargo.toml
index db594c64083..e092f61e8f3 100644
--- a/rust/qemu-api/Cargo.toml
+++ b/rust/qemu-api/Cargo.toml
@@ -20,8 +20,5 @@ qemu_api_macros = { path = "../qemu-api-macros" }
default = []
allocator = []
-# Do not include in any global workspace
-[workspace]
-
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(MESON)',
'cfg(HAVE_GLIB_WITH_ALIGNED_ALLOC)'] }
--
2.47.0
- [PULL 22/40] rust/pl011: add TYPE_PL011_LUMINARY device, (continued)
- [PULL 22/40] rust/pl011: add TYPE_PL011_LUMINARY device, Paolo Bonzini, 2024/11/04
- [PULL 21/40] rust/pl011: move CLK_NAME static to function scope, Paolo Bonzini, 2024/11/04
- [PULL 23/40] rust/pl011: remove commented out C code, Paolo Bonzini, 2024/11/04
- [PULL 24/40] rust/pl011: Use correct masks for IBRD and FBRD, Paolo Bonzini, 2024/11/04
- [PULL 25/40] rust: patch bilge-impl to allow compilation with 1.63.0, Paolo Bonzini, 2024/11/04
- [PULL 28/40] rust: introduce a c_str macro, Paolo Bonzini, 2024/11/04
- [PULL 27/40] rust: use std::os::raw instead of core::ffi, Paolo Bonzini, 2024/11/04
- [PULL 26/40] rust: fix cfgs of proc-macro2 for 1.63.0, Paolo Bonzini, 2024/11/04
- [PULL 30/40] rust: synchronize dependencies between subprojects and Cargo.lock, Paolo Bonzini, 2024/11/04
- [PULL 29/40] rust: silence unknown warnings for the sake of old compilers, Paolo Bonzini, 2024/11/04
- [PULL 31/40] rust: create a cargo workspace,
Paolo Bonzini <=
- [PULL 33/40] rust: do not use MaybeUninit::zeroed(), Paolo Bonzini, 2024/11/04
- [PULL 32/40] rust: introduce alternative implementation of offset_of!, Paolo Bonzini, 2024/11/04
- [PULL 34/40] rust: clean up detection of the language, Paolo Bonzini, 2024/11/04
- [PULL 35/40] rust: allow version 1.63.0 of rustc, Paolo Bonzini, 2024/11/04
- [PULL 36/40] rust: do not use --generate-cstr, Paolo Bonzini, 2024/11/04
- [PULL 38/40] rust: make rustfmt optional, Paolo Bonzini, 2024/11/04
- [PULL 37/40] rust: allow older version of bindgen, Paolo Bonzini, 2024/11/04