mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/5] MAKEALL: return error code from do_build_target
Date: Thu, 22 Aug 2024 13:57:27 +0200	[thread overview]
Message-ID: <20240822115730.1184500-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240822115730.1184500-1-a.fatoum@pengutronix.de>

The script currently records only if any config build failed to control
the exit code, but doesn't return an error code from each single
do_build_target. We need this though, when we start running the test
suite for successful builds, so let's add a return value and rename the
global ret variable to a more descriptive exitcode.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 MAKEALL | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/MAKEALL b/MAKEALL
index 861d397814d9..df318c6d123c 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -8,7 +8,7 @@ warnings_list=""
 nb_errors=0
 errors_list=""
 nb_defconfigs=0
-ret=0
+exitcode=0
 
 time_start=$(date +%s)
 
@@ -72,7 +72,7 @@ stats() {
 	fi
 	echo "----------------------------------------------------------"
 
-	exit ${ret}
+	exit ${exitcode}
 }
 
 check_pipe_status() {
@@ -89,6 +89,7 @@ do_build_target() {
 	local target_time_start=$(date +%s)
 	local log_report="${LOGDIR}/${target}/report.log"
 	local log_err="${LOGDIR}/${target}/errors.log"
+	local err=0
 
 	[ "$INCREMENTAL" != "1" ] && rm -rf "${BUILDDIR}"
 	mkdir -p "${LOGDIR}/${target}"
@@ -148,12 +149,14 @@ do_build_target() {
 			printf "FAILED \n" | tee -a "${log_report}"
 			nb_errors=$((nb_errors + 1))
 			errors_list="${errors_list} ${target}"
-			ret=1
+			err=1
+			exitcode=1
 		fi
 	else
 		printf "FAILED \n" | tee -a "${log_report}"
 		printf "Compile: ------ \n" | tee -a "${log_report}"
-		ret=1
+		err=1
+		exitcode=1
 	fi
 
 	if [ -s "${log_err}" ] ; then
@@ -168,6 +171,8 @@ do_build_target() {
 	target_time_stop=$(date +%s)
 	target_time_diff=$((${target_time_stop} - ${target_time_start}))
 	printf "Compiled in %4is\n" ${target_time_diff} | tee -a "${log_report}"
+
+	return $err
 }
 
 do_build() {
-- 
2.39.2




  reply	other threads:[~2024-08-22 11:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22 11:57 [PATCH 1/5] test: conftest.py: move top-level Ahmad Fatoum
2024-08-22 11:57 ` Ahmad Fatoum [this message]
2024-08-22 11:57 ` [PATCH 3/5] MAKEALL: don't build all configs wen defconfigs given Ahmad Fatoum
2024-08-22 11:57 ` [PATCH 4/5] MAKEALL: add support for running pytest after build Ahmad Fatoum
2024-08-22 11:57 ` [PATCH 5/5] Documentation: board: emulated: rewrite to use MAKEALL/pytest directly Ahmad Fatoum
2024-08-23  8:04 ` [PATCH 1/5] test: conftest.py: move top-level Sascha Hauer

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=20240822115730.1184500-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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