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

 
 

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

Submitted by:  None
Submitted on:  Mon 30 Nov 2009 05:03:42 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating System: MS Windows
Fixed Release: 3.82Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project 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>
Project 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 File(s):
   
   
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
  • -unavailable- added by eliz (Updated the item)
  • -unavailable- added by psmith (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Jul 2010 06:13:30 AM UTCpsmithFixed Release4.0=>3.82
    Fri 11 Dec 2009 03:59:10 PM UTCelizAttached File-=>Added w32builtins.dif, #19239
      StatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.0
    Mon 30 Nov 2009 05:36:09 AM UTCpsmithOperating SystemNone=>MS Windows

    Back to the top


    Powered by Savane 3.1-cleanup1