[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: should assigning to .SHELLFLAGS suppress fast path?

From: David Boyce
Subject: Re: should assigning to .SHELLFLAGS suppress fast path?
Date: Wed, 11 Feb 2015 13:29:15 -0800

On Wed, Feb 11, 2015 at 12:22 PM, Paul Smith <address@hidden> wrote:
On Wed, 2015-02-11 at 10:44 -0800, David Boyce wrote:
> I just noticed that while assigning to SHELL suppresses the fast-path
> algorithm, assigning to .SHELLFLAGS does not. Feature or bug?

That's a good question.  I'm sort of agnostic on it.  On one hand, it's
hard to think of a flag added to SHELLFLAGS (given the default value of
SHELL) that would matter for the fast path

Actually it gets weirder. Some values of .SHELLFLAGS suppress fast path, others do not:

% cat makefile
foo:; @echo making $@
% strace -e process -q -f -- make-4.1 .SHELLFLAGS=-ec 2>&1 | grep 'execve.* = 0'
[pid 23605] execve("/bin/echo", ["echo", "making", "foo"], [/* 46 vars */]) = 0
% strace -e process -q -f -- make-4.1 .SHELLFLAGS=-xc 2>&1 | grep 'execve.* = 0'
[pid 23745] execve("/bin/sh", ["/bin/sh", "-xc", "echo making foo"], [/* 46 vars */]) = 0

The two straced invocations differ only in that one adds -e to .SHELLFLAGS and the other adds -x.

Wait … ChangeLog.3 says:

        (construct_command_argv_internal): If .SHELLFLAGS is non-standard
        use the slow path.  Use that value instead of hard-coded "-c”.

But apparently -c and -ec are both considered standard so I guess it works as designed.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]