Skip to contentSkip to conversation

"MAKEALL: Add summary information" breaks MAKEALL return code

U-Boot Wolfgang Denk 2 participants 2 messages Dec 5, 2009 – Dec 6, 2009

lore
Share & tools
lore
#0 lore raw

Dear Peter,

your commit 40a28f0885 (MAKEALL: Add summary information) breaks MAKEALL because we now don't get any useful return code any more. You may argument that we didn't get one before, which is correct for building multiple boards in one call. But when running something like "MAKEALL <board>" we did get a return code, so wee could use this for example with "git bisect run".

One possible fix could look like this:

MAKEALL +3 -0
index d63c5c2..0cafed8 100755
@@ -952,13 +952,16 @@ build_target() {
 #-----------------------------------------------------------------------
 
 print_stats() {
+	rc=0
 	echo ""
 	echo "--------------------- SUMMARY ----------------------------"
 	echo "Boards compiled: ${TOTAL_CNT}"
 	if [ ${ERR_CNT} -gt 0 ] ; then
+		rc=1
 		echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )"
 	fi
 	echo "----------------------------------------------------------"
+	exit $rc
 }
 
 #-----------------------------------------------------------------------

But I don't really like this approach, as it still changes behaviour:
now even warnings get accounted as errors. What do you think?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
An expert is a person who avoids the small errors while  sweeping  on
to the grand fallacy.
#1 lore raw

Hi Wolfgang,

Quoted 6 lines

your commit 40a28f0885 (MAKEALL: Add summary information) breaks MAKEALL because we now don't get any useful return code any more. You may argument that we didn't get one before, which is correct for building multiple boards in one call. But when running something like "MAKEALL <board>" we did get a return code, so wee could use this for example with "git bisect run".

I'm not seeing a useful return code before the change:

ptyser at petert u-boot $ git reset --hard 40a28f0885~1 HEAD is now at 71ce9bd galaxy5200: enable version environment variable ptyser at petert u-boot $ echo "asdf" >> common/cmd_nvedit.c ptyser at petert u-boot $ ./MAKEALL MVBLUE; echo $? Configuring for MVBLUE board...
cmd_nvedit.c:643: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
make[1]: *** [cmd_nvedit.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [common/libcommon.a] Error 2
powerpc-linux-size: './u-boot': No such file
0

ptyser at petert u-boot $ git checkout master
M common/cmd_nvedit.c
Already on "master"
Your branch is behind 'origin/master' by 334 commits, and can be fast-forwarded.
ptyser at petert u-boot $ echo "asdf" >> common/cmd_nvedit.c ptyser at petert u-boot $ ./MAKEALL MVBLUE; echo $? Configuring for MVBLUE board...
cmd_nvedit.c:644: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asdf'
make[1]: *** [cmd_nvedit.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [common/libcommon.a] Error 2
powerpc-linux-size: './u-boot': No such file
0

Do you have an example of what breaks?

It seems like the behavior should be the same before/after the change. In both cases the last command is "tee -a ${LOG_DIR}/$target.MAKELOG", which always returns 0.

I agree that it would be nice to have a valid return code either way though:)

Peter

Quoted 32 lines

One possible fix could look like this:

MAKEALL +3 -0
index d63c5c2..0cafed8 100755
@@ -952,13 +952,16 @@ build_target() {
 #-----------------------------------------------------------------------
 
 print_stats() {
+	rc=0
 	echo ""
 	echo "--------------------- SUMMARY ----------------------------"
 	echo "Boards compiled: ${TOTAL_CNT}"
 	if [ ${ERR_CNT} -gt 0 ] ; then
+		rc=1
 		echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )"
 	fi
 	echo "----------------------------------------------------------"
+	exit $rc
 }
 
 #-----------------------------------------------------------------------

But I don't really like this approach, as it still changes behaviour:
now even warnings get accounted as errors. What do you think?

Best regards,

Wolfgang Denk