Re: Bug in $(shell ...) I can't understand

2022-02-06 Thread Paul Smith
On Sun, 2022-02-06 at 17:12 -0500, Dmitry Goncharov wrote: > This behavior is correct, is not it? > > $ cat makefile > SHELL:=/badpath/bash > value:=$(shell echo hello world) > all: ; $(info $(value)) > $ make >/dev/null > make: /badpath/bash: No such file or directory > $ > > stdout is

Re: Bug in $(shell ...) I can't understand

2022-02-06 Thread Dmitry Goncharov
On Sun, Feb 6, 2022 at 3:28 PM Paul Smith wrote: > Oh. I see the problem. If the shell exits with an exit code of 127 > then make's shell function assumes that it failed because the sub- > process was not found, and it actually writes its output to stderr!! This behavior is correct, is not it?

Re: Bug in $(shell ...) I can't understand

2022-02-06 Thread Paul Smith
On Sun, 2022-02-06 at 15:21 -0500, Paul Smith wrote: > I'm not sure this is correct.  I will need to think about it. I decided this was a bug and changed the behavior for the next release.

Re: Bug in $(shell ...) I can't understand

2022-02-06 Thread Dmitry V. Levin
On Sun, Feb 06, 2022 at 03:21:39PM -0500, Paul Smith wrote: > On Sun, 2022-02-06 at 20:18 +0300, Dmitry V. Levin wrote: > > 4175643 write(2, "/bin/sh: bad-program: command no"..., > > 40) = 40 > > 4175640 <... read resumed>"/bin/sh: bad-program: command no"..., 200) = 40 > > 4175640 read(5,  > >

Re: Bug in $(shell ...) I can't understand

2022-02-06 Thread Britton Kerin
On Sun, Feb 6, 2022 at 8:19 AM Dmitry V. Levin wrote: > > On Sun, Feb 06, 2022 at 11:23:03AM -0500, Paul Smith wrote: > > OK, someone posted a question to SO and that led me to an hour or more > > of banging my head against a wall trying to understand what's > > happening... and I can't. > > > >

Re: Bug in $(shell ...) I can't understand

2022-02-06 Thread Paul Smith
On Sun, 2022-02-06 at 20:18 +0300, Dmitry V. Levin wrote: > 4175643 write(2, "/bin/sh: bad-program: command no"..., > 40) = 40 > 4175640 <... read resumed>"/bin/sh: bad-program: command no"..., 200) = 40 > 4175640 read(5,  > 4175643 +++ exited with 127 +++ > 4175640 <... read resumed>"", 160)

Re: Bug in $(shell ...) I can't understand

2022-02-06 Thread Martin Dorey
itry V. Levin Sent: Sunday, February 6, 2022 09:18 To: Paul Smith Cc: bug-make@gnu.org Subject: Re: Bug in $(shell ...) I can't understand * EXTERNAL EMAIL * On Sun, Feb 06, 2022 at 11:23:03AM -0500, Paul Smith wrote: > OK, someone posted a question to SO and that led me to an hour o

Re: Bug in $(shell ...) I can't understand

2022-02-06 Thread Dmitry V. Levin
On Sun, Feb 06, 2022 at 11:23:03AM -0500, Paul Smith wrote: > OK, someone posted a question to SO and that led me to an hour or more > of banging my head against a wall trying to understand what's > happening... and I can't. > > The problem is that the user would like to invoke $(shell ...) and >

Bug in $(shell ...) I can't understand

2022-02-06 Thread Paul Smith
OK, someone posted a question to SO and that led me to an hour or more of banging my head against a wall trying to understand what's happening... and I can't. The problem is that the user would like to invoke $(shell ...) and capture errors, even errors that the program being run doesn't exist.