qemu-rust
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] scripts: add script to help distro use global Rust packages


From: Neal Gompa
Subject: Re: [PATCH] scripts: add script to help distro use global Rust packages
Date: Tue, 22 Jul 2025 08:01:38 -0400

On Tue, Jul 22, 2025 at 4:35 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Some distros prefer to avoid vendored crate sources, and instead use
> local sources from e.g. ``/usr/share/cargo/registry``.  Add a
> script, inspired by the Mesa spec file(*), that automatically
> performs this task.  The script is meant to be invoked after unpacking
> the QEMU tarball.
>
> (*) This is the hack that Mesa uses:
>
>     export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/"
>     %define inst_crate_nameversion() %(basename %{cargo_registry}/%{1}-*)
>     %define rewrite_wrap_file() sed -e "/source.*/d" -e 
> "s/%{1}-.*/%{inst_crate_nameversion %{1}}/" -i subprojects/%{1}.wrap
>     %rewrite_wrap_file proc-macro2
>     ... more %rewrite_wrap_file invocations follow ...
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  docs/about/build-platforms.rst           |   8 +
>  scripts/get-wraps-from-cargo-registry.py | 191 +++++++++++++++++++++++
>  2 files changed, 199 insertions(+)
>  create mode 100755 scripts/get-wraps-from-cargo-registry.py
>

I am impressed how much code my three lines in the Mesa spec file produced.

The code looks good to me and seems to do what it says on the tin.

Reviewed-by: Neal Gompa <ngompa@fedoraproject.org>



-- 
Neal Gompa (FAS: ngompa)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]