[PATCH v1] automation: use PYTHON for qemu-deps-check.py

Olaf Hering posted 1 patch 2 months, 2 weeks ago
Failed in applying to current master (apply log)
automation/scripts/build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v1] automation: use PYTHON for qemu-deps-check.py
Posted by Olaf Hering 2 months, 2 weeks ago
This enables use of something else than the system 'python3' binary.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 automation/scripts/build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 34416297a4..5d806c235a 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -93,7 +93,7 @@ else
 
     # Qemu requires Python 3.8 or later, and ninja
     # and Clang 10 or later
-    if ! type python3 || ! python3 automation/scripts/qemu-deps-check.py \
+    if ! type "${PYTHON:-python3}" || ! "${PYTHON:-python3}" automation/scripts/qemu-deps-check.py \
             || [[ "$cc_is_clang" == y && "$cc_ver" -lt 0x0a0000 ]] \
             || ! type ninja; then
         cfgargs+=("--with-system-qemu=/bin/false")
Re: [PATCH v1] automation: use PYTHON for qemu-deps-check.py
Posted by Andrew Cooper 2 months, 2 weeks ago
On 07/10/2024 4:22 pm, Olaf Hering wrote:
> This enables use of something else than the system 'python3' binary.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  automation/scripts/build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/automation/scripts/build b/automation/scripts/build
> index 34416297a4..5d806c235a 100755
> --- a/automation/scripts/build
> +++ b/automation/scripts/build
> @@ -93,7 +93,7 @@ else
>  
>      # Qemu requires Python 3.8 or later, and ninja
>      # and Clang 10 or later
> -    if ! type python3 || ! python3 automation/scripts/qemu-deps-check.py \
> +    if ! type "${PYTHON:-python3}" || ! "${PYTHON:-python3}" automation/scripts/qemu-deps-check.py \
>              || [[ "$cc_is_clang" == y && "$cc_ver" -lt 0x0a0000 ]] \
>              || ! type ninja; then
>          cfgargs+=("--with-system-qemu=/bin/false")
>

Thanks, but I'm just about to delete this whole construct in order to
avoid wasting so much CI time doing redundant builds of QEMU.

I expect the end result to with your adjustment to the Leap container,
with no change necessary here.

While I think it's useful to have Leap able to do builds of QEMU given
how easy it is to fix, I'll be removing it by default from Gitlab runs. 
We spend more than ~50% of wallclock time building QEMU, when 99% of
changes aren't even liable to change the interaction with QEMU.

~Andrew

Re: [PATCH v1] automation: use PYTHON for qemu-deps-check.py
Posted by Stefano Stabellini 2 months, 2 weeks ago
On Mon, 7 Oct 2024, Andrew Cooper wrote:
> On 07/10/2024 4:22 pm, Olaf Hering wrote:
> > This enables use of something else than the system 'python3' binary.
> >
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > ---
> >  automation/scripts/build | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/automation/scripts/build b/automation/scripts/build
> > index 34416297a4..5d806c235a 100755
> > --- a/automation/scripts/build
> > +++ b/automation/scripts/build
> > @@ -93,7 +93,7 @@ else
> >  
> >      # Qemu requires Python 3.8 or later, and ninja
> >      # and Clang 10 or later
> > -    if ! type python3 || ! python3 automation/scripts/qemu-deps-check.py \
> > +    if ! type "${PYTHON:-python3}" || ! "${PYTHON:-python3}" automation/scripts/qemu-deps-check.py \
> >              || [[ "$cc_is_clang" == y && "$cc_ver" -lt 0x0a0000 ]] \
> >              || ! type ninja; then
> >          cfgargs+=("--with-system-qemu=/bin/false")
> >
> 
> Thanks, but I'm just about to delete this whole construct in order to
> avoid wasting so much CI time doing redundant builds of QEMU.
> 
> I expect the end result to with your adjustment to the Leap container,
> with no change necessary here.
> 
> While I think it's useful to have Leap able to do builds of QEMU given
> how easy it is to fix, I'll be removing it by default from Gitlab runs. 
> We spend more than ~50% of wallclock time building QEMU, when 99% of
> changes aren't even liable to change the interaction with QEMU.

I agree with you 100%.

We could switch the default so that QEMU is not built unless explicitely
requested, maybe via a job variable similar to "debug" or
"HYPERVISOR_ONLY".
Re: [PATCH v1] automation: use PYTHON for qemu-deps-check.py
Posted by Olaf Hering 2 months, 2 weeks ago
Mon, 7 Oct 2024 16:35:13 +0100 Andrew Cooper <andrew.cooper3@citrix.com>:

> We spend more than ~50% of wallclock time building QEMU, when 99% of
> changes aren't even liable to change the interaction with QEMU.

Makes sense, thank you.


Olaf