Tue 10 Aug 2010 04:08:27 PM UTC, original submission:
When setting a different SHELL than standard Windows shell, it is not being executed when recipe is about to be made. This is related to bug #30714 - shell is not being invoked if the command is a shell built-in and is not recognized.
Consider the following Makefile:
SHELL := C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe
foo: bar
Copy-Item $< $@
bar:
New-Item -type file $@
The result is:
$> make -d -r
[...]
find_and_set_shell() setting default_shell = C:/WINDOWS/system32/WindowsPowerShell/v1.0/powershell.exe
Updating makefiles....
Considering target file `Makefile'.
Looking for an implicit rule for `Makefile'.
No implicit rule found for `Makefile'.
Finished prerequisites of target file `Makefile'.
No need to remake target `Makefile'.
Updating goal targets....
Considering target file `foo'.
File `foo' does not exist.
Considering target file `bar'.
File `bar' does not exist.
Finished prerequisites of target file `bar'.
Must remake target `bar'.
Invoking recipe from Makefile:7 to update target `bar'.
New-Item -type file bar
CreateProcess(NULL,New-Item -type file bar,...)
process_begin: CreateProcess(NULL, New-Item -type file bar, ...) failed.
Putting child 0095DF18 (bar) PID 9834824 on the chain.
Live child 0095DF18 (bar) PID 9834824
Main thread handle = 000007D8
make (e=2): The system cannot find the file specified.
Reaping losing child 0095DF18 PID 9834824
make: *** [bar] Error 2
Removing child 0095DF18 PID 9834824 from chain.
This is against the documentation which says:
"When it is time to execute recipes to update a target, they are executed by invoking a new subshell for each line of the recipe, unless the .ONESHELL special target is in effect (see Using One Shell) (In practice, make may take shortcuts that do not affect the results.)"
The shortcut taken is not to run shell and this makes setting $(SHELL) useless.
This is also reproducible on 3.82.
|