bug-make
[Top][All Lists]
Advanced

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

Infinite loop bug with parallel make


From: Ian Lynagh
Subject: Infinite loop bug with parallel make
Date: Fri, 22 Feb 2013 02:31:08 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

Hi all,

The attached Makefile causes an infinite loop with parallel make when
using make 3.81 (on amd64/Linux):

    $ make setup
    touch B.hs A.hs
    sleep 2
    touch B.hi B.dyn_hi
    sleep 2
    touch B.o B.dyn_o
    sleep 2
    touch A.dyn_hi
    sleep 2
    touch A.o A.dyn_o

    $ make so
    true 1 B.hi B.o
    false 1
    make: *** [so] Error 1

    $ make so -j2
    true 1 B.hi B.o
    [doesn't terminate]

I can't reproduce it with 3.82, but I don't know for sure whether it's
fixed or whether it's just luck that it doesn't get tickled.


However, even if it is fixed in 3.82, that doesn't really help me right
now as I would really like my build system to work with the make that
people have installed, and 3.81 is still very common.

Is anyone able to explain what causes the bug, so that I can try to
alter the build system to avoid it, please?

Also, is there a way to tell make not to treat any file as intermediate?
I think that it's possible that this would work around the problem.
If that's not possible, then if I can make a list of all files that the
build system might build then adding
    list of all files : | exists
    exists:
        touch $@
would do it, right?
Although then, if the build system didn't actually find a rule for a
file in the list, then the dependency on exists would make it think
that it could build it; is there any way to avoid that?


Thanks
Ian

Attachment: Makefile
Description: Text document


reply via email to

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