Paolo Bonzini <pbonz...@redhat.com> writes:

> The next commit will introduce a new build dependency for rust/qemu-api,
> version_check.  Before adding it, ensure that all dependencies are
> synchronized between the Meson- and cargo-based build systems.
>
> Note that it's not clear whether in the long term we'll use Cargo for
> anything; it seems that the three main uses (clippy, rustfmt, rustdoc)

Here's a fourth use case: "cargo expand" for debugging Rust macros.

> can all be invoked manually---either via glue code in QEMU, or by
> extending Meson to gain the relevant functionality.  However, for
> the time being we're stuck with Cargo so it should at least look at
> the same code as the rest of the build system.
>
> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
> ---
>  rust/hw/char/pl011/Cargo.lock   |  5 +++-
>  rust/qemu-api-macros/Cargo.lock | 11 ++++----
>  rust/qemu-api/Cargo.lock        | 49 ++++++++++++++++++++++++++++++++-
>  rust/qemu-api/Cargo.toml        |  1 +
>  4 files changed, 59 insertions(+), 7 deletions(-)
>
> diff --git a/rust/hw/char/pl011/Cargo.lock b/rust/hw/char/pl011/Cargo.lock
> index b58cebb186e..82028ddf793 100644
> --- a/rust/hw/char/pl011/Cargo.lock
> +++ b/rust/hw/char/pl011/Cargo.lock
> @@ -1,6 +1,6 @@
>  # This file is automatically @generated by Cargo.
>  # It is not intended for manual editing.
> -version = 3
> +version = 4

V4 was introduced in Rust 1.78. Should we stick to V3 as the MSRV is 1.63.0?

>
>  [[package]]
>  name = "arbitrary-int"
> @@ -91,6 +91,9 @@ dependencies = [
>  [[package]]
>  name = "qemu_api"
>  version = "0.1.0"
> +dependencies = [
> + "qemu_api_macros",
> +]

I would suggest adding those dependencies and version constraints in
Cargo.toml, not Cargo.lock. Future devices in Rust will have their
Cargo.lock derived from Cargo.toml of qemu-api and qemu-api-macro, so
missing version info there will force device writers to manually tweak
their Cargo.lock.

--
Best Regards
Junjie Mao

Reply via email to