aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-07-22 09:50:01 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-07-25 14:51:05 +0200
commitfbc8fb36e3636854195705cba13278befb94158d (patch)
treee5015ef6f796f21b1cf8bc57d68803e637ce4dfe /docs
parentf63000d943bd7db60b338f12546a96efaa6058aa (diff)
downloadqemu-fbc8fb36e3636854195705cba13278befb94158d.zip
qemu-fbc8fb36e3636854195705cba13278befb94158d.tar.gz
qemu-fbc8fb36e3636854195705cba13278befb94158d.tar.bz2
scripts: add script to help distros use global Rust packages
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 ... Reviewed-by: Neal Gompa <ngompa@fedoraproject.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/about/build-platforms.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
index 8ecbd6b..8671c3b 100644
--- a/docs/about/build-platforms.rst
+++ b/docs/about/build-platforms.rst
@@ -127,6 +127,14 @@ Rust build dependencies
(or newer) package. The path to ``rustc`` and ``rustdoc`` must be
provided manually to the configure script.
+ Some distros prefer to avoid vendored crate sources, and instead use
+ local sources from e.g. ``/usr/share/cargo/registry``. QEMU includes a
+ script, ``scripts/get-wraps-from-cargo-registry.py``, that automatically
+ performs this task. The script is meant to be invoked after unpacking
+ the QEMU tarball. QEMU also includes ``rust/Cargo.toml`` and
+ ``rust/Cargo.lock`` files that can be used to compute QEMU's build
+ dependencies, e.g. using ``cargo2rpm -p rust/Cargo.toml buildrequires``.
+
Optional build dependencies
Build components whose absence does not affect the ability to build QEMU
may not be available in distros, or may be too old for our requirements.