bugmake - Bugs: bug #30730, SHELL does not work correctly on...

 
 

bug #30730: SHELL does not work correctly on Windows

Submitter:  Krzysztof Malinowski <raspy>
Submitted:  Tue 10 Aug 2010 04:08:27 PM UTC
   
 
Severity:  1 - Wish Item Group:  Enhancement
Status:  Later Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  3.81 Operating System:  MS Windows
Fixed Release:  None Triage Status:  Major Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 27 Apr 2013 05:18:12 PM UTC, comment #1: 

Make on Windows currently supports only the default Windows shell cmd.exe or compatible replacements, or ports of Unixy shells, such as the ported Bash.

Volunteers are welcome to contribute code for other shells, including PowerShell.

Eli Zaretskii <eliz>
Group Member
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.

Krzysztof Malinowski <raspy>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eliz (Posted a comment)
  • -email is unavailable- added by raspy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-04-27 eliz Severity3 - Normal 1 - Wish
        Item GroupBug Enhancement
        StatusNone Later
        Triage StatusNone Major Effort

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code