On 2/27/25 11:07, Joel Granados wrote:
Here is the error I see:
cmd:
   meson introspect --buildoptions /home/joel/src/qemu/meson.build

output:
   meson.build:88:12: ERROR: Unknown compiler(s): [['rustc']]
   The following exception(s) were encountered:
   Running `rustc --version` gave "[Errno 2] No such file or directory: 'rustc'"

Thanks, this helps.

When I pass it a builddir it actually gives me all the buildoptions
(which is what I expect)
cmd:
   meson introspect --buildoptions /home/joel/src/qemu/bdir

Yes, the difference is that the builddir version uses the results of actually executing meson.build, whereas the srcdir version only does some cursory parsing and always looks at both branches of "if" statements.

This is actually not a bug, and in fact now I remember why it is using the srcdir version... Looking at the required languages is needed in order to figure out language-dependent build options, and the srcdir version includes the options for all languages that QEMU could use.

None of the language-dependent options (for example c_std) are surfaced in meson-buildoptions.sh, which is why your patch works in the first place. But I think it's a better fix for you to install rustc, since it will anyway become mandatory sooner or later.

Paolo

Quickly looking at the error message and at line 88 shows me that it has
to do with the build trying to call the rust compiler (which I do
**not** have installed). It seems that have_rust has the true value even
though I do not have it installed. However all this goes away when I
pass it a builddir.

Maybe the fix is to change the detection logic for the rust compiler?
FYI:
1. These are the lines that have rust in the meson_options.txt:
   option('rust', type: 'feature', value: 'disabled',
          description: 'Rust support')
   option('strict_rust_lints', type: 'boolean', value: false,
          description: 'Enable stricter set of Rust warnings')
2. This is how I run configure:
   ../configure --target-list=x86_64-softmmu --disable-docs

Notice that in meson.build:88 the value of has_rust depends on
have_system which in turn depends on target_dirs. Does target_dirs have
values outside a builddir?


Reply via email to