This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: cygwin 2.0.2, make 4.1: stderr redirect append does not work with native Windows programs
- From: "Lemke, Michael ST/HZA-ZSW" <lemkemch at schaeffler dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Wed, 13 May 2015 08:16:51 +0000
- Subject: RE: cygwin 2.0.2, make 4.1: stderr redirect append does not work with native Windows programs
- Authentication-results: sourceware.org; auth=none
- References: <5551188B dot 7050503 at coverity dot com> <55525B85 dot 90001 at coverity dot com>
On May 12, 2015 9:59 PM Scott McPeak wrote:
>
>Using 32-bit cygwin 2.0.2 and make 4.1-1, in a recipe, redirecting
>stderr in append mode does not work if the program being invoked on a
>shell line is a native Windows executable. Instead of appending, the
>stderr output is written to the top of the file, corrupting it. This
>happens only if the 'make' process has its own stdout/err redirected to
>a pipe.
>
>Example recipe:
>
> all:
> echo first > output
> echo
>secondxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >> output
> /cygdrive/c/Windows/System32/sort.exe nonexist 2>> output; true
>
>When "make" is run, the "output" file should be:
>
> first
> secondxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> nonexistThe system cannot find the file specified.
>
>and in fact it is. But when "make 2>&1 | cat" is run, the output is:
>
> nonexistThe system cannot find the file specified.
> xxxxxxxxxxxxxx
>
>even though it should be the same as before. The error message written
>by sort.exe went to the top of the file instead of the end.
Just a wild guess here: line endings? Try
make 2>&1 | cat -A
and see if everything's there.
Michael
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple