[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #57674] regression in make 4.3 with makefile from stdin
From: |
Paul Smith |
Subject: |
Re: [bug #57674] regression in make 4.3 with makefile from stdin |
Date: |
Wed, 01 Apr 2020 09:02:06 -0400 |
On Wed, 2020-04-01 at 14:14 +0200, Andreas Schwab wrote:
> On Mär 31 2020, Paul D. Smith wrote:
>
> > In GNU make 4.3, for performance reasons we choose to use
> > posix_spawn() if it's available on the system. posix_spawn()
> > doesn't do any path search, so we do it ourselves and we don't have
> > this backup default PATH lookup that execvp() does.
>
> There is also posix_spawnp.
Unfortunately it's hard to use for us.
The fork/exec code worked by first forking, then installing the child's
environment, then running execvp. This ensured that the PATH lookup
happened with the child's environment.
posix_spawnp obviously does not do the fork, which means that it will
do the path lookup with the parent's environment, which is wrong (for
us at least).
The only option would be to setenv the child's PATH before invoking
posix_spawnp() then set it back again afterward.