Commit graph

4 commits

Author SHA1 Message Date
LingMan
49446a62c0 meson: specify minimal target meson version for rust subprojects
Silences several meson warnings like:
```
../subprojects/equivalent-1.0.1/meson.build:9: WARNING: Project does not target a minimum version but uses feature introduced in '1.3.0': rust_abi arg in static_library.
```

The target of 1.7.0 was chosen since that's the minimal required meson version of the rust components in mesa anyway.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38814>
2025-12-12 17:28:49 +00:00
LingMan
f53f35cb32 meson: silence warnings in rust subprojects
Rust 1.91 as well as clippy show various benign warnings in our dependencies. Silence them since we
can't really do much about them anyway and we want to enforce clippy complience via CI in the
future.

Matches cargo behavior, which also doesn't show warnings or clippy lints outside the workspace.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38814>
2025-12-12 17:28:49 +00:00
Gurchetan Singh
d60c19fd10 subprojects: enable proper cross-compile on MinGW of certain crates
The virtgpu_kumquat deps -- used by gfxstream -- don't work
with cross-compile.  This is because they set "native: true" even
for host machine deps.

In addition, some proc-macro deps (which need "native: true") try
to link against host machine deps.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
2025-11-24 06:56:07 -08:00
Paolo Bonzini
8ea232a9ae meson: rename Rust subprojects to NAME-SEMVER-rs
Use the convention for Rust subprojects that was adopted by Meson 1.5.0
and newer.

Distros would prefer to avoid vendored crate sources, and instead use
local sources from e.g. /usr/share/cargo/registry.  While Meson does not
support a local registry, it can be emulated with MESON_PACKAGE_CACHE_DIR.

However, because the distro might not be using the exact version of the
package, but only one that has the same semver, packagers need to add
some hacks to rewrite the wrap files.  For example, in Fedora:

    export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/"
    # So... Meson can't actually find them without tweaks
    %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
    %rewrite_wrap_file quote
    %rewrite_wrap_file syn
    %rewrite_wrap_file unicode-ident
    %rewrite_wrap_file paste

Having a common convention for the name of Rust wraps makes it possible
to perform this transformation with a script without listing
the wraps one by one, and to share the script across multiple packages
(which will be useful when QEMU starts using Rust in a similar way to Mesa).

For an example of such a script, see
https://lore.kernel.org/r/20250722083507.678542-1-pbonzini@redhat.com/.

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36284>
2025-07-24 17:52:34 +00:00