From 95e82f9b38a1fa5b2b99103e3685750b3c5a084b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 14 Oct 2024 16:36:40 +0200 Subject: meson: check in main meson.build for native Rust compiler A working native Rust compiler is always needed in order to compile Rust code, even when cross compiling, in order to build the procedural macros that QEMU uses. Right now, the check is done in rust/qemu-api-macros/meson.build, but this has two disadvantages. First, it makes the build fail when the Meson "rust" option is set to "auto" (instead, Rust support should be disabled). Second, add_languages() is one of the few functions that are executed even by "meson introspect", except that "meson introspect" executes both branches of "if" statements! Therefore, "meson introspect" tries to look for a Rust compiler even if the option is disabled---and then fails because the compiler is required by rust/qemu-api-macros/meson.build. This is visible for example if the compilation host has a stale scripts/meson-buildoptions.sh and no rustc installed. Both issues can be fixed by moving the check to the main meson.build, together with the check for the cross compiler. Reported-by: Peter Maydell Signed-off-by: Paolo Bonzini Signed-off-by: Peter Maydell --- rust/qemu-api-macros/meson.build | 2 -- 1 file changed, 2 deletions(-) (limited to 'rust/qemu-api-macros') diff --git a/rust/qemu-api-macros/meson.build b/rust/qemu-api-macros/meson.build index 48af91e..517b9a4 100644 --- a/rust/qemu-api-macros/meson.build +++ b/rust/qemu-api-macros/meson.build @@ -1,5 +1,3 @@ -add_languages('rust', required: true, native: true) - quote_dep = dependency('quote-1-rs', native: true) syn_dep = dependency('syn-2-rs', native: true) proc_macro2_dep = dependency('proc-macro2-1-rs', native: true) -- cgit v1.1