bugmake - Bugs: bug #28126, bug with Windows interface: echo....

 
 

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

Submitter:  None
Submitted:  Mon 30 Nov 2009 05:03:42 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.81 Operating System:  MS Windows
Fixed Release:  3.82 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 14 Dec 2009 04:12:13 AM UTC, comment #5: 

Well, at least there is some progress after 3 and a half years...

Eli Zaretskii <eliz>
Group Member
Sun 13 Dec 2009 09:47:40 PM UTC, comment #4: 

[Submitted by J. David Bryan, jdbryan at acm dot org]

Thanks, but we've already had this discussion:

http://lists.gnu.org/archive/html/make-w32/2006-03/msg00057.html

Please disregard comment #2; I'll continue to apply a local patch.

Anonymous
Sat 12 Dec 2009 09:09:15 AM UTC, comment #3: 

I omitted those commands on purpose: they are executable programs on some older Windows versions, not shell built-ins.

But if you, or someone else, can present a real-life use-case where it is good to have them as built-ins, I will consider changing my mind.

Eli Zaretskii <eliz>
Group Member
Sat 12 Dec 2009 04:49:23 AM UTC, comment #2: 

[Submitted by J. David Bryan, jdbryan at acm dot org]

Would you consider adding the "move," "popd," "pushd," and "start" built-in commands as well?

Anonymous
Fri 11 Dec 2009 03:59:10 PM UTC, comment #1: 

Fixed with the attached patch (which adds a couple more builtin commands).


(file #19239)

Eli Zaretskii <eliz>
Group Member
Mon 30 Nov 2009 05:03:42 AM UTC, original submission:  

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:\tmp>make foobar

C:\tmp>


However, this one:

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

gives:

C:\tmp>make 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

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #19239:  w32builtins.dif added by eliz (1KiB - application/vnd.ms-excel)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eliz (Updated the item)
  • -email is unavailable- added by psmith (Updated 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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-28 psmith Fixed Release4.0 3.82
    2009-12-11 eliz Attached File- Added w32builtins.dif, #19239
        StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.0
    2009-11-30 psmith Operating SystemNone MS Windows

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code