NetBSD-Bugs archive

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

bin/55542: make: parallel builds and double-colon don't get along

>Number:         55542
>Category:       bin
>Synopsis:       make: parallel builds and double-colon don't get along
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 05 09:00:00 +0000 2020
>Originator:     David A. Holland
>Release:        NetBSD 9.99.69 (20200805)
System: irrelevant
Architecture: x86_64
Machine: amd64

Using double-colon dependencies with -j doesn't work.


   --- Makefile ---
foo:: quack1
        sleep 1; echo 1

foo:: quack2
        sleep 2; echo 2

foo:: quack3
        sleep 3; echo 3

valkyrie% touch quack{1,2,3}
valkyrie% ./make -j3
--- foo ---
--- foo ---
--- foo ---
--- foo ---
sleep 1; echo 1
--- foo ---
sleep 2; echo 2
--- foo ---
sleep 3; echo 3
--- foo ---
--- foo ---
make: foo#1: cohort has parents

make: stopped in /tmp/muckle

Note that the 2 appears one second after the 1; it's run the three
shell commands for the target concurrently, and choked on the results.


I haven't yet dug through to find out what it's choking on or what the
internal representation thinks should be happening. Or whether this
has always been broken since make was first parallelized or if
something's come adrift more recently.

However, given that this is all about a single target, it seems very
unlikely that in any real setting it can be regenerated correctly by
running the different sets of shell commands concurrently, and that
make should not try to parallelize these. (And FWIW, this seems to be
what gmake does.)

Home | Main Index | Thread Index | Old Index