Skip to contentSkip to conversation

utils/test-pkg: stop on sigint

PATCH Applied James Knight 2 participants 3 messages Jul 1, 2025 – Jul 11, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils/test-pkg: stop on sigint

When SIGINT is issued for a package test run, it will abort the active toolchain run then proceed to the next. If a user is running the entire default toolchain set (-a), they can be required to invoke SIGINT multiple times to stop a run.

This commit uses a SIGINT hook to flag a shutdown state and stop further attempts to run anymore toolchain tests.

---
 utils/test-pkg | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
utils/test-pkg +11 -1
index 19d8713d6a..cd77964252 100755
@@ -3,6 +3,11 @@ set -e
 
 TOOLCHAINS_CSV='support/config-fragments/autobuild/toolchain-configs.csv'
 TEMP_CONF=""
+abort=0
+
+do_abort() {
+    abort=1
+}
 
 do_clean() {
     if [ -n "${TEMP_CONF}" ]; then
@@ -67,7 +72,8 @@ main() {
         esac
     done
 
-    trap do_clean INT TERM HUP EXIT
+    trap do_abort INT
+    trap do_clean TERM HUP EXIT
 
     if [ -z "${cfg}" ]; then
         pkg_br_name="${pkg//-/_}"
@@ -139,6 +145,10 @@ main() {
         (3) : $((nb_legal++)); printf "FAILED\n";;
         (4) : $((nb_show++)); printf "FAILED\n";;
         esac
+
+        if [ "${abort}" -eq 1 ]; then
+            return 1
+        fi
     done
 
     printf "%d builds, %d skipped, %d build failed, %d legal-info failed, %d show-info failed\n" \
Signature · 6 lines
2.49.0.windows.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 9 lines · James Knight

When SIGINT is issued for a package test run, it will abort the active toolchain run then proceed to the next. If a user is running the entire default toolchain set (-a), they can be required to invoke SIGINT multiple times to stop a run.

This commit uses a SIGINT hook to flag a shutdown state and stop further attempts to run anymore toolchain tests.

Applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to James Knight

In reply of:

Quoted 9 lines

When SIGINT is issued for a package test run, it will abort the active toolchain run then proceed to the next. If a user is running the entire default toolchain set (-a), they can be required to invoke SIGINT multiple times to stop a run.

This commit uses a SIGINT hook to flag a shutdown state and stop further attempts to run anymore toolchain tests.

Applied to 2025.02.x & 2025.05.x. Thanks

Quoted 48 lines
---
 utils/test-pkg | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
utils/test-pkg +11 -1
index 19d8713d6a..cd77964252 100755
@@ -3,6 +3,11 @@ set -e
 
 TOOLCHAINS_CSV='support/config-fragments/autobuild/toolchain-configs.csv'
 TEMP_CONF=""
+abort=0
+
+do_abort() {
+    abort=1
+}
 
 do_clean() {
     if [ -n "${TEMP_CONF}" ]; then
@@ -67,7 +72,8 @@ main() {
         esac
     done
 
-    trap do_clean INT TERM HUP EXIT
+    trap do_abort INT
+    trap do_clean TERM HUP EXIT
 
     if [ -z "${cfg}" ]; then
         pkg_br_name="${pkg//-/_}"
@@ -139,6 +145,10 @@ main() {
         (3) : $((nb_legal++)); printf "FAILED\n";;
         (4) : $((nb_show++)); printf "FAILED\n";;
         esac
+
+        if [ "${abort}" -eq 1 ]; then
+            return 1
+        fi
     done
 
     printf "%d builds, %d skipped, %d build failed, %d legal-info failed, %d show-info failed\n" \
Signature · 6 lines
2.49.0.windows.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot