bug-make
[Top][All Lists]
Advanced

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

[bug #30714] List of shell commands is outdated/Fallback to shell


From: Krzysztof Malinowski
Subject: [bug #30714] List of shell commands is outdated/Fallback to shell
Date: Tue, 10 Aug 2010 15:50:50 +0000
User-agent: Mozilla/5.0 (Windows; Windows NT 5.1; rv:2.0b2) Gecko/20100720 Firefox/4.0b2 ( .NET CLR 3.5.30729; .NET4.0E)

Follow-up Comment #5, bug #30714 (project make):

But this is exactly the case. Searching for 'move' in PATH fails, so shell
should be started to parse the command. However, instead of starting the shell
the command is just being passed to the system, and the system fails to run
it.

Let me illustrate it. Suppose the following Makefile:

foo: bar
        move /y $< $@

bar: baz
        copy $< $@

baz:
        mem > $@

'mem' in baz target is C:WINDOWSSYSTEM32mem.exe, 'copy' in bar target is a
recognized built-in, while 'move' in foo target is an unrecognized built-in.

See what happens:

$> make -d
[...]
Updating goal targets....
Considering target file `foo'.
 File `foo' does not exist.
  Considering target file `bar'.
   File `bar' does not exist.
    Considering target file `baz'.
     File `baz' does not exist.
     Finished prerequisites of target file `baz'.
    Must remake target `baz'.
Creating temporary batch file D:Profilesakm022LOCALS~1Tempmake8964-1.bat
mem > baz
CreateProcess(D:Profilesakm022LOCALS~1Tempmake8964-1.bat,D:Profilesakm022LOCALS~1Tempmake8964-1.bat,...)
Putting child 0x009647b0 (baz) PID 9860272 on the chain.
Live child 0x009647b0 (baz) PID 9860272
Main thread handle = 0x000007c0
Reaping winning child 0x009647b0 PID 9860272
Cleaning up temp batch file D:Profilesakm022LOCALS~1Tempmake8964-1.bat
Removing child 0x009647b0 PID 9860272 from chain.
    Successfully remade target file `baz'.
   Finished prerequisites of target file `bar'.
  Must remake target `bar'.
Creating temporary batch file D:Profilesakm022LOCALS~1Tempmake8964-1.bat
copy baz bar
CreateProcess(D:Profilesakm022LOCALS~1Tempmake8964-1.bat,D:Profilesakm022LOCALS~1Tempmake8964-1.bat,...)
Putting child 0x009669a0 (bar) PID 9860272 on the chain.
Live child 0x009669a0 (bar) PID 9860272
        1 file(s) copied.
Reaping winning child 0x009669a0 PID 9860272
Cleaning up temp batch file D:Profilesakm022LOCALS~1Tempmake8964-1.bat
Removing child 0x009669a0 PID 9860272 from chain.
  Successfully remade target file `bar'.
 Finished prerequisites of target file `foo'.
Must remake target `foo'.
move /y bar foo
CreateProcess(NULL,move /y bar foo,...)
process_begin: CreateProcess(NULL, move /y bar foo, ...) failed.
Putting child 0x009687e8 (foo) PID 9860272 on the chain.
Live child 0x009687e8 (foo) PID 9860272
make (e=2): The system cannot find the file specified.
Reaping losing child 0x009687e8 PID 9860272
make: *** [foo] Error 2

Generally for baz and bar targets shell is executed (batch file created and
run - note the first argument to CreateProcess is non-NULL). This happens when
either a) command is found on PATH or b) command is a known built-in. What
happens in foo target is that make tries to run the command directly through
the system, which is against what documentations states about it ("they are
executed by invoking a new subshell for each line"). My point here is that the
shell should be called here, not the system directly. After all the system
won't do anything more than the shell would do, but it can do less because of
shell built-ins which are valid only in shell (and the system won't process
them).

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?30714>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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