Skip to contentSkip to conversation

automation: use PYTHON for qemu-deps-check.py

PATCH In review Olaf Hering 3 participants 4 messages Oct 7, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 automation: use PYTHON for qemu-deps-check.py

This enables use of something else than the system 'python3' binary.

---
 automation/scripts/build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
automation/scripts/build +1 -1
index 34416297a4..5d806c235a 100755
@@ -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")
#1 lore raw
Quoted 13 lines · Olaf Hering

This enables use of something else than the system 'python3' binary.

---
 automation/scripts/build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
automation/scripts/build +0 -0
index 34416297a4..5d806c235a 100755

automation/scripts/build else · line 99

Quoted 8 lines
automation/scripts/build +1 -1
@@ -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

#2 lore raw

Mon, 7 Oct 2024 16:35:13 +0100 Andrew Cooper <[email protected]>:

Quoted 2 lines

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

#3 lore raw
In reply to Andrew Cooper
Quoted 26 lines · Andrew Cooper
Quoted 13 lines · Olaf Hering

This enables use of something else than the system 'python3' binary.

---
 automation/scripts/build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
automation/scripts/build +0 -0
index 34416297a4..5d806c235a 100755

automation/scripts/build else · line 99

Quoted 8 lines
automation/scripts/build +1 -1
@@ -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.

Quoted 7 lines

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".