qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] configure, meson: synchronize defaults for configure and Meson Rust options
@ 2024-10-14 11:01 Paolo Bonzini
  2024-10-14 11:45 ` Peter Maydell
  2024-10-14 16:04 ` Peter Maydell
  0 siblings, 2 replies; 6+ messages in thread
From: Paolo Bonzini @ 2024-10-14 11:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Manos Pitsidianakis, Peter Maydell, Daniel P. Berrangé

If the defaults for --enable-rust ($rust in configure) and Meson's rust
option are out of sync, incremental builds will pick Meson's default.

This happens because, on an incremental build, configure does not run
Meson, Make does instead.  Meson then gets the command line options
from either coredata.dat (which has everything cached in Python's pickle
format) or cmd_line.txt (slow path when Meson version is upgraded), but
neither knows about the rust option, and the meson_options.txt default
is used.

This will cause have_rust to be true if rustc is available; and the build
to fail because configure did not put a RUST_TARGET_TRIPLE in config-host.mak.

When in the Rust pull request I changed the $rust default from auto
to disabled, I should have made the same change to meson_options.txt;
do it now.

Cc: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Reported-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure         | 2 +-
 meson_options.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 3e38a91616a..8a9a4153310 100755
--- a/configure
+++ b/configure
@@ -1987,7 +1987,7 @@ if test "$skip_meson" = no; then
   fi
 
   # QEMU options
-  test "$rust" != "auto" && meson_option_add "-Drust=$rust"
+  test "$rust" != "disabled" && meson_option_add "-Drust=$rust"
   test "$cfi" != false && meson_option_add "-Dcfi=$cfi" "-Db_lto=$cfi"
   test "$docs" != auto && meson_option_add "-Ddocs=$docs"
   test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
diff --git a/meson_options.txt b/meson_options.txt
index 2211f291b2d..fc6d5526d58 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -372,5 +372,5 @@ option('hexagon_idef_parser', type : 'boolean', value : true,
 option('x86_version', type : 'combo', choices : ['0', '1', '2', '3', '4'], value: '1',
        description: 'tweak required x86_64 architecture version beyond compiler default')
 
-option('rust', type: 'feature', value: 'auto',
+option('rust', type: 'feature', value: 'disabled',
        description: 'Rust support')
-- 
2.46.2



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

end of thread, other threads:[~2024-10-14 16:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-14 11:01 [PATCH] configure, meson: synchronize defaults for configure and Meson Rust options Paolo Bonzini
2024-10-14 11:45 ` Peter Maydell
2024-10-14 12:09   ` Peter Maydell
2024-10-14 13:45     ` Peter Maydell
2024-10-14 13:54     ` Peter Maydell
2024-10-14 16:04 ` Peter Maydell

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).