qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Joel Granados <joel.granados@kernel.org>
Cc: qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH] build: Replace meson introspection argument with a builddir
Date: Thu, 27 Feb 2025 11:19:53 +0100	[thread overview]
Message-ID: <d788bb12-0d69-43eb-bf09-a94ead71c9e4@redhat.com> (raw)
In-Reply-To: <opabljxycyh2huu4yicopg5dkur56pntyehozkrp2tai5orgnz@frubtj4drvma>

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	other threads:[~2025-02-27 10:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 20:10 [PATCH] build: Replace meson introspection argument with a builddir Joel Granados
2025-02-24  9:49 ` Thomas Huth
2025-02-24 10:57 ` Paolo Bonzini
2025-02-27 10:07   ` Joel Granados
2025-02-27 10:19     ` Paolo Bonzini [this message]
2025-02-27 10:38       ` Peter Maydell
2025-02-28 14:11         ` Joel Granados

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d788bb12-0d69-43eb-bf09-a94ead71c9e4@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=joel.granados@kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).