NetBSD Problem Report #55542
From dholland@netbsd.org Wed Aug 5 08:58:00 2020
Return-Path: <dholland@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 43F491A923A
for <gnats-bugs@gnats.NetBSD.org>; Wed, 5 Aug 2020 08:58:00 +0000 (UTC)
Message-Id: <20200805085759.E686C84D71@mail.netbsd.org>
Date: Wed, 5 Aug 2020 08:57:59 +0000 (UTC)
From: dholland@NetBSD.org
Reply-To: dholland@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: make: parallel builds and double-colon don't get along
X-Send-Pr-Version: 3.95
>Number: 55542
>Category: toolchain
>Synopsis: make: parallel builds and double-colon don't get along
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: toolchain-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Aug 05 09:00:00 +0000 2020
>Last-Modified: Thu Aug 20 00:52:48 +0000 2020
>Originator: David A. Holland
>Release: NetBSD 9.99.69 (20200805)
>Organization:
>Environment:
System: irrelevant
Architecture: x86_64
Machine: amd64
>Description:
Using double-colon dependencies with -j doesn't work.
>How-To-Repeat:
--- 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 ---
1
--- foo ---
2
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.
>Fix:
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.)
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: bin-bug-people->toolchain-bug-people
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Wed, 05 Aug 2020 23:17:34 +0000
Responsible-Changed-Why:
make PRs belong in "toolchain"
protip: don't file PRs while half asleep
Responsible-Changed-From-To: toolchain-bug-people->toolchain-manager
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Thu, 20 Aug 2020 00:52:48 +0000
Responsible-Changed-Why:
use right address, too.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.