On Thu, Feb 27, 2025 at 10:38:11AM +0000, Peter Maydell wrote: > On Thu, 27 Feb 2025 at 10:20, Paolo Bonzini <pbonz...@redhat.com> wrote: > > > > 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. > > It's not mandatory *now*, though. So I think it would be better > to fix whatever this problem is rather than papering over it...
Would my fix work even though there is no BUILD_DIR? If I understand Paolo's point (and please correct me if I don't) this is supposed to run with and without a builddir. My point being that I would also get an error if the update-buildoptions target is called with BUILD_DIR = CURDIR (default value). cmd: meson introspect --buildoptions /home/joel/src/qemu output: Current directory is not a meson build directory. Please specify a valid build dir or change the working directory to it. It is a pity that not finding rustc results in an error and exit instead of just trimming that if branch but continuing to see what options are available Best -- Joel Granados