make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make3.81-beta4 mingw not failing on error?


From: Matt England
Subject: Re: make3.81-beta4 mingw not failing on error?
Date: Wed, 08 Mar 2006 12:50:49 -0600

Greg,

Your testing feedback is fantastic, it's just what I seek. Thank you very much. Here's my summary interpretation of at least one data point that I feel is pertinent:

Running from msys's own bash.exe/sh.exe...

$/c/msys/1.0/bin/make main.exe

...produces the result I want, while...

$../make-3.81beta4/make main.exe

...does not.

In short, the 'g++ -M' error stops the msys make, while the same error does not stop the 3.81beta4 make (using the same environment). I was getting the same behavior with make-3.81rc1 (as per my original logs posted to this list); I can confirm later. I've been in meetings this morning, haven't gotten back to a machine yet.

I suspect this nature of this issue comes back to Earnie's point:

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

I'll be attempting to run a cmd.exe-based make-3.81rc1 later today to further test/analyze Earnie's suspicion. If this does end up being the issue, I'm still curious: how can I build a msys make that conforms to the proper standards to avoid this problem (referenced in the above email from Earnie)? What procedure must I use?

I'm hoping to make a mingw-users post about this later today; any feedback welcome here. I get the impression Earnie patrols the mingw-users list as well, but maybe there are others there that know more. Maybe there's a mingw-developers list that might shed more light, too.

An aside: I could have run these tests earlier (and probably should to confirm Greg's experience), but I didn't think to do that. Great catch, Greg.

FWIW, I can't use the /c/msys/1.0/bin/make executable in my builds, because it's revved at 3.79, which does not support the $(eval) function, which is critical to my Makefile system. (It helps build the dynamic rules I feel I need to keep the makefiles sane.)

-Matt


At 3/8/2006 08:40 AM, Greg Chicares wrote:
On 2006-3-8 3:31 UTC, Matt England wrote:
>
> Thanks for helping helping out with this, this was just the sort of
> testing I'm seeking.
>
> At 3/7/2006 09:14 PM, Greg Chicares wrote:
>
[...]
>> /c/tmp/me_make-test[2]$../make-3.81beta4/make
>> g++ -c  main.cpp -o main.o
>> main.cpp:1:21: sys/msg.h: No such file or directory
>> make: *** [main.o] Error 1
[...]
>>
>> That's the desired stop-on-error behavior, right?
>
> Actually, know.  I want it to stop on the "g++ -M" (or "g++ -MM", almost
> the same thing) lines, which say something like "--generating makefile...".
>
> To do this, run:
>
> make main.exe
> make alt1.exe
>
> ...I think.  (I had to mod my Makefile and usage instructions to make it
> simple).
>
> and/or run:
>
> make all

OK, I see now: you're treating 'make all' as a special case
by testing for 'all' in $(MAKECMDGOALS), and likewise for
the two '.exe' targets.

First, let's try MSYS's own 'make' in its own 'bash':

/c/tmp/me_make-test[0]$ls
Makefile  alt1.cpp  main.cpp
/c/tmp/me_make-test[0]$/c/msys/1.0/bin/make main.exe
-- generating makefile: main.d
set -e; rm -f main.d;                                          \
echo "# DO NOT CHANGE THIS FILE; it was auto-generated by a make process." > main.d; \
g++ -M  main.cpp > main.d.2608;                      \
sed 's,^.*\.o[ :]*,main.o main.d: ,g' < main.d.2608 >> main.d;  \
rm -f main.d.2608
main.cpp:1:21: sys/msg.h: No such file or directory
make: *** [main.d] Error 1
/c/tmp/me_make-test[2]$ls
Makefile  alt1.cpp  main.cpp  main.d  main.d.2608
/c/tmp/me_make-test[0]$cat main.d
# DO NOT CHANGE THIS FILE; it was auto-generated by a make process.

Neither the 'sed' nor the last 'rm' command was executed,
and 'make' stopped right there, which is what you want.

Now let's try the release candidate:

/c/tmp/me_make-test[0]$ls
Makefile  alt1.cpp  main.cpp
/c/tmp/me_make-test[0]$../make-3.81beta4/make main.exe
-- generating makefile: main.d
set -e; rm -f main.d;                                          \
echo "# DO NOT CHANGE THIS FILE; it was auto-generated by a make process." > main.d; \
        g++ -M  main.cpp > main.d.3760;                      \
        sed 's,^.*\.o[ :]*,main.o main.d: ,g' < main.d.3760 >> main.d;  \
        rm -f main.d.3760
main.cpp:1:21: sys/msg.h: No such file or directory
g++ -c  main.cpp -o main.o
main.cpp:1:21: sys/msg.h: No such file or directory
make: *** [main.o] Error 1
/c/tmp/me_make-test[2]$ls
Makefile  alt1.cpp  main.cpp  main.d  main.d.3760

This time, 'make' didn't stop where expected: it proceeded
to attempt 'g++ -c  main.cpp -o main.o'. I think that's the
problem you're reporting.

Now let's try the same thing in a native msw port of zsh:

C:/tmp/me_make-test[0]$path=(/MinGW-20050120/bin/ /usr/bin/ /usr/local/bin/)

First, the old make I've been using for so many years that
I don't remember where it came from. This zsh port doesn't
seem to understand $(PID), so I'll force it to 9999.

C:/tmp/me_make-test[0]$ls
Makefile          alt1.cpp          main.cpp          make-test.tar.gz
C:/tmp/me_make-test[0]$make main.exe PID=9999
-- generating makefile: main.d
set -e; rm -f main.d;                                          \
echo "# DO NOT CHANGE THIS FILE; it was auto-generated by a make process." > mai
n.d;                                   \
g++ -M  main.cpp > main.d.9999;                      \
sed 's,^.*\.o[ :]*,main.o main.d: ,g' < main.d.9999 >> main.d;  \
rm -f main.d.9999
main.cpp:1:21: sys/msg.h: No such file or directory
\usr\bin\\make.EXE: *** [main.d] Error 1

'make' stopped on the failing command. FWIW:

C:/tmp/me_make-test[2]$make --version
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for mingw32
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
        Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to <address@hidden>.

Now the release candidate:

C:/tmp/me_make-test[0]$ls
Makefile          alt1.cpp          main.cpp          make-test.tar.gz
C:/tmp/me_make-test[0]$../make-3.81beta4/make main.exe PID=9999
-- generating makefile: main.d
set -e; rm -f main.d;                                          \
echo "# DO NOT CHANGE THIS FILE; it was auto-generated by a make process
." > main.d;                                   \
        g++ -M  main.cpp > main.d.9999;                      \
        sed 's,^.*\.o[ :]*,main.o main.d: ,g' < main.d.9999 >> main.d;  \
        rm -f main.d.9999
main.cpp:1:21: sys/msg.h: No such file or directory
g++ -c  main.cpp -o main.o
main.cpp:1:21: sys/msg.h: No such file or directory
make.EXE: *** [main.o] Error 1
C:/tmp/me_make-test[2]$

Here, 'make' proceeded past the first failing command.
So it looks like the problem can be reproduced without
using MSYS's bash--instead using a non-MSYS zsh and
an MSYS-built 'make' beta.

Here's some debug output with the release candidate:

CreateProcess(C:\usr\bin\sh.exe,/usr/bin/sh.exe -c "set -e; rm -f main.d;
                                   \
echo \"# DO NOT CHANGE THIS FILE; it was auto-generated by a make process.\" > m
ain.d;                                   \
g++ -M  main.cpp > main.d.9999;                      \
sed 's,^.*\.o[ :]*,main.o main.d: ,g' < main.d.9999 >> main.d;  \
rm -f main.d.9999",...)
Live child 0x00c22100 (main.d) PID 12722752
main.cpp:1:21: sys/msg.h: No such file or directory
Reaping losing child 0x00c22100 PID 12722752
Removing child 0x00c22100 PID 12722752 from chain.
 Failed to remake target file `main.d'.
 Considering target file `Makefile'.
[...]
 No need to remake target `Makefile'.
Updating goal targets....
Considering target file `main.exe'.
 File `main.exe' does not exist.
  Considering target file `main.o'.
   File `main.o' does not exist.
    Pruning file `main.cpp'.
   Finished prerequisites of target file `main.o'.
  Must remake target `main.o'.
g++ -c  main.cpp -o main.o
CreateProcess(C:\MinGW-20050120\bin\g++.exe,g++ -c main.cpp -o main.o,...)
Putting child 0x00c23530 (main.o) PID 12722752 on the chain.
Live child 0x00c23530 (main.o) PID 12722752
main.cpp:1:21: sys/msg.h: No such file or directory
Reaping losing child 0x00c23530 PID 12722752
make.EXE: *** [main.o] Error 1

and from the old 'make' that seems to work as desired:

CreateProcess(C:\usr\bin\sh.exe,/usr/bin/sh.exe -c "set -e; rm -f main.d;
echo \"# DO NOT CHANGE THIS FILE; it was aut o-generated by a make process.\" > main.d; g+ + -M main.cpp > main.d.9999; sed 's,^.*\.o[ :]*,main.o ma
in.d: ,g' < main.d.9999 >> main.d;   rm -f main.d.9999",...)
Live child 0x003de110 (main.d) PID 4057464
main.cpp:1:21: sys/msg.h: No such file or directory
Reaping losing child 0x003de110 PID 4057464
\usr\bin\\make.EXE: *** [main.d] Error 1
Removing child 0x003de110 PID 4057464  from chain.

So where the release candidate says

Reaping losing child 0x00c22100 PID 12722752
Removing child 0x00c22100 PID 12722752 from chain.

the old version of 'make' says

Reaping losing child 0x003de110 PID 4057464
\usr\bin\\make.EXE: *** [main.d] Error 1
Removing child 0x003de110 PID 4057464  from chain.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]