From: Peter Maydell <peter.maydell@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Peter Foley" <pefoley@google.com>,
qemu-devel@nongnu.org, "Kevin Wolf" <kwolf@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Alexandre Iooss" <erdnaxe@crans.org>,
"Mahmoud Mandour" <ma.mandourr@gmail.com>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
qemu-block@nongnu.org, nabihestefan@google.com
Subject: Re: [PATCH] Use meson's detected python installation
Date: Mon, 8 Sep 2025 09:48:15 +0100 [thread overview]
Message-ID: <CAFEAcA8r_dw1bBrVr1vexCb0QOm1NFmo2FPMpQEFP8RGwgqcEA@mail.gmail.com> (raw)
In-Reply-To: <6e43209d-645f-46e4-a23a-2a1ec149dfe8@redhat.com>
On Fri, 5 Sept 2025 at 08:26, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 9/4/25 17:11, Peter Foley wrote:
> > Relying on `python3` to be avilable in $PATH doesn't work in some build
> > environments. Update the build files to use the found python binary
> > explicitly.
>
> Meson already does this, if the file is not executable. See
> docs/devel/build-system.rst:
>
> Meson has a special convention for invoking Python scripts: if their
> first line is ``#! /usr/bin/env python3`` and the file is *not*
> executable, find_program() arranges to invoke the script under the
> same Python interpreter that was used to invoke Meson. This is the
> most common and preferred way to invoke support scripts from Meson
> build files, because it automatically uses the value of configure's
> --python= option.
>
> Using "[python, 'foo']" is only needed for scripts "where it is
> desirable to make the script executable (for example for test scripts
> that developers may want to invoke from the command line, such as
> tests/qapi-schema/test-qapi.py)".
Wow, this seems like a super fragile way to do things. My
natural expectation would be that scripts generally would
be executable. If we accidentally make a script executable
that meson is invoking without explicit [python, ...]
then everything continues to work for almost everybody,
except in this corner case where the 'python3' on the path
is sufficiently wrong to not work: so we're likely to not
notice the mistake for ages.
-- PMM
prev parent reply other threads:[~2025-09-08 8:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 15:11 [PATCH] Use meson's detected python installation Peter Foley
2025-09-05 7:25 ` Paolo Bonzini
2025-09-05 15:01 ` Peter Foley
2025-09-06 14:33 ` Paolo Bonzini
2025-09-08 8:48 ` Peter Maydell [this message]
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=CAFEAcA8r_dw1bBrVr1vexCb0QOm1NFmo2FPMpQEFP8RGwgqcEA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=erdnaxe@crans.org \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=ma.mandourr@gmail.com \
--cc=marcandre.lureau@redhat.com \
--cc=nabihestefan@google.com \
--cc=pbonzini@redhat.com \
--cc=pefoley@google.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).