Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jan 2003 16:34:35 +0100
From:      Gerhard Sittig <Gerhard.Sittig@gmx.net>
To:        current@FreeBSD.ORG
Subject:   Re: alpha tinderbox failure
Message-ID:  <20030105163435.V4807@shell.gsinet.sittig.org>
In-Reply-To: <20030105175202.N14167-100000@gamplex.bde.org>; from bde@zeta.org.au on Sun, Jan 05, 2003 at 06:00:26PM %2B1100
References:  <2994.1041712055@critter.freebsd.dk> <20030105175202.N14167-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 05, 2003 at 18:00 +1100, Bruce Evans wrote:
> 
> On Sat, 4 Jan 2003 phk@FreeBSD.ORG wrote:
> 
> > In message <20030104201357.D27142A8A5@canning.wemm.org>, Peter Wemm writes:
> > >> No, it isn't the regression tests.  It is this here in the start of stage 4:
> > >>
> > >> ===> usr.bin/vi
> > >> *** Error code 1 (ignored)
> > >> *** Error code 1 (ignored)
> > >> ===> usr.bin/vis
> > >>
> > >> As soon as 'whereintheworld' sees an 'error code', it starts dumping that
> > >> entire block to the end.  If you care to find and fix the build in vi, that
> > >> would solve it.
> >
> > I think it would be more profitable to teach "whereintheworld" about
> > the "(ignored)" string, wouldn't it ?
> 
> No; it would be more profitable to teach programmers to not ignore errors.

Amen! :]

Although the above case is special from what I learnt in another
message in this thread (I managed to delete it after seeing it so
I cannot quote it here).  ISTR that the non zero exit status comes
from a tool with the following convention:  0 is "absolutely OK",
1 is "not perfect but still plausible enough to get accepted most
of the time", and 2 is "a real error, never OK".

So the exit code of 1 is more of a warning than an error.  Ignoring
_any_ non zero exit status in the Makefile is an error.  The rule
should instead accept success and warning messages as success while
bailing out on the errors.  This can be done with shell syntax as I
have seen in some small test:

  $ sh -c 'exit 0'; [ $? -le 1 ]
  $ echo $?
  0

  $ sh -c 'exit 1'; [ $? -le 1 ]
  $ echo $?
  0

  $ sh -c 'exit 2'; [ $? -le 1 ]
  $ echo $?
  1

  $ sh -c 'exit 3'; [ $? -le 1 ]
  $ echo $?
  1

This means:  adding the "[ $? -le 1 ]" test to the Makefile rule
and *not* ignoring the command's (sequence's) exit status will
prevent the acceptable warning from stopping the build while real
errors do break the build as one would expect from make(1).  And
the mentioned tool (sorry, I don't remember its name) is still
able to warn those who are interested (release builders?).


virtually yours   82D1 9B9C 01DC 4FB4 D7B4  61BE 3F49 4F77 72DE DA76
Gerhard Sittig   true | mail -s "get gpg key" Gerhard.Sittig@gmx.net
-- 
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030105163435.V4807>