[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #47171] please fall back to system() when command is not found
From: |
Zoltan |
Subject: |
Re: [bug #47171] please fall back to system() when command is not found on $PATH |
Date: |
Tue, 16 Feb 2016 19:34:08 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:34.0) Gecko/20100101 SeaMonkey/2.31 |
On 02/16/2016 12:34 PM, Manoj Srivastava wrote:
> but POSIX sayeth
>
> | An execution line is built from the command line by removing
> | any prefix characters. Except as described under the at-sign
> | prefix, the execution line shall be written to the standard
> | output, optionally preceded by a <tab>. The execution line |
> | shall then be executed by a shell as if it were passed as the
> | argument to the system( ) interface, except that the shell −e
> | option shall also be in effect.
>
> The cause is that "make" expects to be run on a POSIX system, where
> non-special shell builtins like "command" would be available for use by execvp
> (see sh_cmds[] in job.c). See the explanation by Jilles Tjoelker at
> http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=43;bug=436466
> for more details.
>
If you had stated that the bug is that the ".POSIX" target doesn't conform to
this (from make info):
`.POSIX'
If `.POSIX' is mentioned as a target, then the makefile will be
parsed and run in POSIX-conforming mode. This does _not_ mean
that only POSIX-conforming makefiles will be accepted: all advanced
GNU `make' features are still available. Rather, this target
causes `make' to behave as required by POSIX in those areas where
`make''s default behavior differs.
In particular, if this target is mentioned then recipes will be
invoked as if the shell had been passed the `-e' flag: the first
failing command in a recipe will cause the recipe to fail
immediately.
Then I think you'd be right. In fact, in adding ".POSIX:" to your makefile
_still_ results in the same error, so I would classify the bug as belonging
to the .POSIX target failure to act "as if the shell had been passed the `-e'
flag".
Note that trying your makefile with "SHELL := /bin/sh -e" does result in the
expected behavior, though its only a w/a.
--
### Any similarity between my views and the truth is completely ###
### coincidental, except that they are endorsed by NO ONE ###