qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] configure: Don't disable Rust for too old meson version
@ 2025-08-11 14:29 Kevin Wolf
  2025-08-12  6:41 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Wolf @ 2025-08-11 14:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, manos.pitsidianakis, qemu-rust

If the user explicitly specified --enable-rust, don't just fail if meson
is too old for Rust support, but do the same thing as if meson was too
old for the C code: Just download a newer one.

In order to avoid the additional download for people who aren't
intentionally opting in to Rust, keep the automatic disabling based on
the meson version as the default if neither --enable-rust nor
--disable-rust were given.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 configure       | 8 +++++---
 pythondeps.toml | 4 ++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 825057ebf1..274a778764 100755
--- a/configure
+++ b/configure
@@ -1186,10 +1186,12 @@ fi
 meson_version=$($meson --version)
 if test "$rust" != disabled && ! version_ge "$meson_version" 1.8.1; then
   if test "$rust" = enabled; then
-    error_exit "Rust support needs Meson 1.8.1 or newer"
+    $mkvenv ensuregroup --dir "${source_path}/python/wheels" \
+         ${source_path}/pythondeps.toml meson-rust || exit 1
+  else
+    echo "Rust needs Meson 1.8.1, disabling" 2>&1
+    rust=disabled
   fi
-  echo "Rust needs Meson 1.8.1, disabling" 2>&1
-  rust=disabled
 fi
 if test "$rust" != disabled && has "$rustc" && $rustc -vV > "${TMPDIR1}/${TMPB}.out"; then
   rust_host_triple=$(sed -n 's/^host: //p' "${TMPDIR1}/${TMPB}.out")
diff --git a/pythondeps.toml b/pythondeps.toml
index b2eec940ce..d0f52b14f7 100644
--- a/pythondeps.toml
+++ b/pythondeps.toml
@@ -22,6 +22,10 @@
 meson = { accepted = ">=1.5.0", installed = "1.8.1", canary = "meson" }
 pycotap = { accepted = ">=1.1.0", installed = "1.3.1" }
 
+[meson-rust]
+# The install key should match the version in python/wheels/
+meson = { accepted = ">=1.8.1", installed = "1.8.1", canary = "meson" }
+
 [docs]
 # Please keep the installed versions in sync with docs/requirements.txt
 sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
-- 
2.50.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] configure: Don't disable Rust for too old meson version
  2025-08-11 14:29 [PATCH] configure: Don't disable Rust for too old meson version Kevin Wolf
@ 2025-08-12  6:41 ` Paolo Bonzini
  2025-08-12 12:57   ` Kevin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2025-08-12  6:41 UTC (permalink / raw)
  To: Kevin Wolf, qemu-devel; +Cc: manos.pitsidianakis, qemu-rust

On 8/11/25 16:29, Kevin Wolf wrote:
> If the user explicitly specified --enable-rust, don't just fail if meson
> is too old for Rust support, but do the same thing as if meson was too
> old for the C code: Just download a newer one.
> 
> In order to avoid the additional download for people who aren't
> intentionally opting in to Rust, keep the automatic disabling based on
> the meson version as the default if neither --enable-rust nor
> --disable-rust were given.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Are you going to submit the patch yourself?

(By the way, I just discovered that IGVM support is incompatible with 
Rust because you end up with two staticlibs...  I'm not yet sure how to 
fix it, other than by compiling libigvm ourselves).

Paolo



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] configure: Don't disable Rust for too old meson version
  2025-08-12  6:41 ` Paolo Bonzini
@ 2025-08-12 12:57   ` Kevin Wolf
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2025-08-12 12:57 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, manos.pitsidianakis, qemu-rust

Am 12.08.2025 um 08:41 hat Paolo Bonzini geschrieben:
> On 8/11/25 16:29, Kevin Wolf wrote:
> > If the user explicitly specified --enable-rust, don't just fail if meson
> > is too old for Rust support, but do the same thing as if meson was too
> > old for the C code: Just download a newer one.
> > 
> > In order to avoid the additional download for people who aren't
> > intentionally opting in to Rust, keep the automatic disabling based on
> > the meson version as the default if neither --enable-rust nor
> > --disable-rust were given.
> 
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> Are you going to submit the patch yourself?

If we want to have it in 10.1 (I don't see why not?), I'm going to send
a pull request today, so I could include it.

Kevin



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-12 12:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 14:29 [PATCH] configure: Don't disable Rust for too old meson version Kevin Wolf
2025-08-12  6:41 ` Paolo Bonzini
2025-08-12 12:57   ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).