Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 May 2004 08:50:32 -0700 (PDT)
From:      Harti Brandt <novo@cs.tu-berlin.de>
To:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/66357: make POSIX conformance problem ('sh -e' & '+' command-line flag) 
Message-ID:  <200405251550.i4PFoWEN027761@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR standards/66357; it has been noted by GNATS.

From: Harti Brandt <novo@cs.tu-berlin.de>
To: "Mark D. Baushke" <mdb@juniper.net>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: standards/66357: make POSIX conformance problem ('sh -e' & '+'
 command-line flag) 
Date: Tue, 25 May 2004 17:43:07 +0200 (MET DST)

 [CC's removed]
 
 [Sorry for the delay, I just discovered that this is still in my mailbox].
 
 On Mon, 10 May 2004, Mark D. Baushke wrote:
 
 > Harti Brandt <novo@cs.tu-berlin.de> writes:
 >
 > > On Fri, 7 May 2004, Mark D. Baushke wrote:
 > >
 > > >
 > > > >Number:         66357
 > > > >Category:       standards
 > > > >Synopsis:       make POSIX conformance problem ('sh -e' & '+' command-line)
 > ...
 > > > >Description:
 > > > Background:
 > > >
 > > > POSIX 1003.2-1997 states that each makefile command line is processed
 > > > as if given to system(3) (see URL
 > > > http://www.opengroup.org/onlinepubs/009695399/utilities/make.html)
 > > >
 > > > POSIX 1003.1-2004 (as well as older versions of the standard) states
 > > > that system() does not use the "sh -e" command to exit immediately if
 > > > any untested command fails in non-interactive mode. (see URL
 > > > http://www.opengroup.org/onlinepubs/009695399/functions/system.html)
 > ...
 > >
 > > The 'sh -e' servers a purpose if you have a more
 > > complicated shell line say a loop. Without -e make will
 > > not stop even if there is an error in an inner command of
 > > a shell loop, while with -e it will exit. I'd say that not
 > > using -e is a posix-bug, not a feature and, in fact, there
 > > has been thoughts on the austin group mailing list to
 > > review this.
 >
 > If you have any particular URLs for those austin group
 > mailing list threads, I would be interested in reading them.
 > I tried to do a quick google search and did not meet with
 > success to finding such a discussion.
 
 I'm currently moving jobs and have no access to my link-list, but
 you should be able to find the mailing lists on the opengroup web page.
 I know that they are not easy to find - watch for Austing Group.
 
 >
 > > I'd think even if we remove the -e in the posix case, we
 > > must retain it in the non-posix case.
 >
 > fwiw: I have found the 'sh -e' feature to be fragile and
 > more likely to do the wrong thing in a complicated action
 > rule especially across multiple platforms.
 
 The big problem is things like
 
 HDRS=a.h b.h c.h
 
 install:
  	for i in $(HDRS) ; do cp $$i /dest ; done
 
 If one of the cp's fail, make should abort. That is possible only when
 doing sh -e. Otherwise a failing cp will just go by unnoticed.
 
 What kind of fragility did you see?
 
 > I also wonder if you will also have time to consider how to
 > deal with a .POSIX: setting in a Makefile after sys.mk has
 > already apparently been read in and processed including a
 > number of .if defined(%POSIX) macros settings being done
 > already before the first line of the user's Makefile is
 > processed...
 
 There is a long way to get our make POSIX compliant. I think this should
 be done very careful step by step. I have already one change in the pipe
 for three months now (standards/57295) - the problem is not to break large
 numbers of ports, so I really don't want to comnment on the %POSIX stuff
 atm. Perhaps it would be best to open another PR for this so we don't mix
 different things.
 
 > I look forward to learning what FreeBSD will do.
 
 I'll try to move our make in the POSIX direction, but, as I said this will
 take some time because make is a very central utility to the system.
 
 Let me first get the above PR finished, the I will move on to this one.
 
 harti



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