From owner-freebsd-standards@FreeBSD.ORG Mon May 10 09:20:27 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4FDE916A4CE for ; Mon, 10 May 2004 09:20:27 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D0A543D49 for ; Mon, 10 May 2004 09:20:26 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i4AGKQNg085413 for ; Mon, 10 May 2004 09:20:26 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i4AGKQ74085412; Mon, 10 May 2004 09:20:26 -0700 (PDT) (envelope-from gnats) Date: Mon, 10 May 2004 09:20:26 -0700 (PDT) Message-Id: <200405101620.i4AGKQ74085412@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: "Mark D. Baushke" Subject: Re: standards/66357: make POSIX conformance problem ('sh -e' & '+' command-line flag) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Mark D. Baushke" List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2004 16:20:27 -0000 The following reply was made to PR standards/66357; it has been noted by GNATS. From: "Mark D. Baushke" To: harti@FreeBSD.ORG Cc: FreeBSD-gnats-submit@FreeBSD.ORG, Paul Eggert , "Simon J. Gerraty" , freebsd-standards@FreeBSD.ORG Subject: Re: standards/66357: make POSIX conformance problem ('sh -e' & '+' command-line flag) Date: Mon, 10 May 2004 09:13:08 -0700 Harti Brandt 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'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. 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... For example, consider the following Makefile: .POSIX: arflags:;@echo ARFLAGS = ${ARFLAGS}, POSIX = ${%POSIX} the FreeBSD 5.2-RELEASE /usr/share/mk/sys.mk has the conditional: .if defined(%POSIX) ARFLAGS ?= -rv .else ARFLAGS ?= rl .endif but the value that /usr/bin/make will print for ARFLAGS in this case is ARFLAGS = rl, POSIX = 1003.2 rather than the correct POSIX value. It all makes some sense when one understands that sys.mk is read first, but I suspect that most folks trying to use .POSIX: may consider it a bug rather than a feature to need to use '%POSIX=1003.2' as an argument on the 'make' command line since %POSIX may not be set an an environment variable in the shell. I look forward to learning what FreeBSD will do. Thank you for your consideration of these problems. -- Mark