bug with Windows interface: echo. in command only works when redirected

2009-11-29 Thread Mark Galeck (CW)
Hello,  I asked for help on this issue (with GNU make on Windows) on the 
help-make list, and Paul Smith says, this is a bug.  I am using WinXP Pro, SP3. 
 Here is an SSCCE:  

makefile:
-
SHELL=cmd.exe
foobar:
@echo.foo


gives me:
C:\tmpmake foobar

C:\tmp


However, this one:

makefile:
-
SHELL=cmd.exe
foobar:
@echo.


gives:

C:\tmpmake foobar
process_begin: CreateProcess(NULL, echo., ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [foobar] Error 2


Here's what Paul says:  

 

I'd guess that this is due to make's fast path processing: if make can 
determine that the command you're invoking does not need a shell, it won't 
start one; instead it will simply try to invoke the command directly.

In this case, the command echo. is not known to make as a command that 
requires a shell, so it tries to run it directly.  In reality this is not a 
real command but rather a builtin command for the Windows shell (for example 
command.com), so trying to invoke it directly fails.

On the other hand, when you run echo.foo make sees the redirection
() and understands that this is not a simple command and can't be run using 
the fast path, so it invokes the shell to run it and it works.

(...)

It's not in the manual because it's supposed to be invisible to the user (that 
is, it's an implementation detail, not a user-visible feature, and so not 
documented in the user manual).  The idea is to improve performance by avoiding 
an extra (and sometimes costly) shell invocation in situations where it can be 
shown that the results are the same either way.

If it's visible to the user, as it is in this case, then there's a bug in the 
fast path processing.

 (end of quotes from Paul)


Mark 


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: bug with Windows interface: echo. in command only works when redirected

2009-11-29 Thread Paul Smith
On Sun, 2009-11-29 at 20:31 -0800, Mark Galeck (CW) wrote:
 Hello,  I asked for help on this issue (with GNU make on Windows) on
 the help-make list, and Paul Smith says, this is a bug.

Hi Mark.  This isn't what I meant by report a bug; go here:

https://savannah.gnu.org/projects/make/

or, more directly, here:

https://savannah.gnu.org/bugs/?group=makefunc=additem

Most GNU projects are managed through Savannah.

Cheers!

-- 
---
 Paul D. Smith psm...@gnu.org  Find some GNU make tips at:
 http://www.gnu.org  http://make.mad-scientist.net
 Please remain calm...I may be mad, but I am a professional. --Mad Scientist



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #28126] bug with Windows interface: echo. in command only works when redirected

2009-11-29 Thread anonymous

URL:
  http://savannah.gnu.org/bugs/?28126

 Summary: bug with Windows interface:  echo. in command only
works when redirected
 Project: make
Submitted by: None
Submitted on: Mon 30 Nov 2009 05:03:42 AM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: 3.81
Operating System: None
   Fixed Release: None
   Triage Status: None

___

Details:

Hello,  I asked for help on this issue (with GNU make on Windows) on the
help-make list, and Paul Smith says, this is a bug.  I am using WinXP Pro,
SP3.  Here is an SSCCE:  

makefile:
-
SHELL=cmd.exe
foobar:
@echo.foo


gives me:
C:\tmpmake foobar

C:\tmp


However, this one:

makefile:
-
SHELL=cmd.exe
foobar:
@echo.


gives:

C:\tmpmake foobar
process_begin: CreateProcess(NULL, echo., ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [foobar] Error 2


Here's what Paul says:  

 

I'd guess that this is due to make's fast path processing: if make can
determine that the command you're invoking does not need a shell, it won't
start one; instead it will simply try to invoke the command directly.

In this case, the command echo. is not known to make as a command that
requires a shell, so it tries to run it directly.  In reality this is not a
real command but rather a builtin command for the Windows shell (for example
command.com), so trying to invoke it directly fails.

On the other hand, when you run echo.foo make sees the redirection
() and understands that this is not a simple command and can't be run
using the fast path, so it invokes the shell to run it and it works.

(...)

It's not in the manual because it's supposed to be invisible to the user
(that is, it's an implementation detail, not a user-visible feature, and so
not documented in the user manual).  The idea is to improve performance by
avoiding an extra (and sometimes costly) shell invocation in situations where
it can be shown that the results are the same either way.

If it's visible to the user, as it is in this case, then there's a bug in the
fast path processing.

 (end of quotes from Paul)


Mark 





___

Reply to this item at:

  http://savannah.gnu.org/bugs/?28126

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



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #28126] bug with Windows interface: echo. in command only works when redirected

2009-11-29 Thread Paul D. Smith

Update of bug #28126 (project make):

Operating System:None = MS Windows 


___

Reply to this item at:

  http://savannah.gnu.org/bugs/?28126

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



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make