From patchwork Wed Jan 9 07:32:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 155053 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp404099jaa; Tue, 8 Jan 2019 23:33:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN7P1EePkWikFd4eHgP3dZtk+9jtuXQR6Q4VdYQUYyAAsXyxrgamq6QesTp8gStwuiAWxHPt X-Received: by 2002:a17:906:7e19:: with SMTP id e25-v6mr4454078ejr.12.1547019196105; Tue, 08 Jan 2019 23:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547019196; cv=none; d=google.com; s=arc-20160816; b=Z5C3QKfrXNACtzylUz0RAUMxxw6HriOPaye10NJkHN/MEdisKokL7e8614Jqymn/Vy ki05Gt5ElptQ+59e3uGwdQAMBlOGQHC0YbqeZNxo5pTLGgtHcPzDh+1yD+EGa5P3UHyC 3EbMOytBrx5+ukzMK0LwZPwelBDXKvMHc5HfZPOzzLU66mGrgErRwbZtDKxI4JaMjP02 QsU91GndpSKPoMSvdD6NQ9TCOhyXzCFaZ1qjIJmalBD0AoRNMIEny+ynUUdo6BPwkHcZ auKmHxxrXgre0QAkL3l4Rcp9qkwZfj+Rraqap4ePrMUTqZ5LfRG6IxnDKmSIOHVzL4+l ciQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:dkim-filter; bh=q2jM0scY6BQoTj5Pzdy5qmi0M3ty+d+9gzN8shfBHwQ=; b=CoAYe8z1PhTLBLlOWhXZmUqf8PpBU/IqdF3ig83mClIb5F7QjwZ5ig1xwqTAqsffbS wIwbTOfwK/H3EVefkb1/UbZ1xnMASuW1EGU3IwMuVVdl3x9QfbrJ+BFDDGmaOW3MyLqb urzuMRRxfFGu9H7YG7yqU/DLhg9Ze3F/S0wOAEXlhEo0jeMv6SpsroGA2sDq3XJxnkyG vxikFszweTtPNbc56geyh08vME+jdEQqkEEBjXfJ+z0D3w3HgJ/BOgkF75aZY9aqdl3I YI+KIkPOJ6y3Yz+UPZClBUWoXqsefGtw67faCHsKlC74ETpDhQozXmiDXqh7VJlVhTar enkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=GCabzXfS; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id p1-v6si179719ejq.55.2019.01.08.23.33.15; Tue, 08 Jan 2019 23:33:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=GCabzXfS; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 35371C21F67; Wed, 9 Jan 2019 07:33:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4D228C21EFC; Wed, 9 Jan 2019 07:33:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0DA20C21ED6; Wed, 9 Jan 2019 07:33:08 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id F3120C21EB9 for ; Wed, 9 Jan 2019 07:33:07 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x097WMMk014604; Wed, 9 Jan 2019 16:32:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x097WMMk014604 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1547019143; bh=ASBir671szS7Vnpf4DZwF7YvKJFEv+YMpbFdapIDAv4=; h=From:To:Cc:Subject:Date:From; b=GCabzXfSG+69n05ghwubVjbJupTlITkatf3Mq3P2zf+oeOg/21qPuQ5TYYKYX46Kn OKrLPlUBzX6ErkkOa67tXcUKSLp2pXY3/1/fbuZH/VoLSwWG9ZwPMDm2mKUPrAb4Dt fKRgy689PLmfrXHdy504Xe9rmqGvMRtp/AldIfzlC8xmMQCZ8W1Ov7gbrbqtx+NWG+ cWfyEtFJDZuVkApv9jfyUiNGVwS+WVoxIjgI21hzaGJlpTSiG2rDAunlhQuebIMGUy /Fo8LKW58Vj6sB9AazwWXn0lDwXbdOPijTUTge+pBTEafV13wjqOlEkHginD408h7X IvNTl+ioiFclg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 9 Jan 2019 16:32:20 +0900 Message-Id: <1547019140-23634-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Cc: Richard Purdie Subject: [U-Boot] [PATCH] kbuild: fix parallel build race caused by u-boot.cfg regeneration X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Multiple people have reported intermittent build failure in parallel building. Kever Yang reported this issue some time ago [1], but I could not get enough clue at that time. This time, Richard Purdie provided a complete build log [2], which was very helpful for me to root-cause it. The cause of the problem is commit 0d982c585330 ("Makefile: add dependencies to regenerate u-boot.cfg when lost"). That commit added the 'cfg' as the prerequisite of the 'all' target, so the parallel build tries to run it simultaneously, then regenerates a symlink while building objects. When u-boot.cfg is accidentally lost, lets' rebuild it before descending into any subdirectories. Also, what is annoying is u-boot.cfg is currently regenerated every time since it depends on FORCE. We can get rid of all the prerequisites of u-boot.cfg because u-boot.cfg is rebuilt anyway as the byproduct of auto.conf when a user updates the .config file. [1] https://lists.denx.de/pipermail/u-boot/2018-June/330341.html [2] https://autobuilder.yoctoproject.org/typhoon/#/builders/65/builds/160/steps/7/logs/step1b Fixes: 0d982c585330 ("Makefile: add dependencies to regenerate u-boot.cfg when lost") Reported-by: Kever Yang Reported-by: Richard Purdie Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index eeb299f..363ebc8 100644 --- a/Makefile +++ b/Makefile @@ -534,7 +534,7 @@ include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd @# Otherwise, 'make silentoldconfig' would be invoked twice. $(Q)touch include/config/auto.conf -u-boot.cfg spl/u-boot.cfg tpl/u-boot.cfg: include/config.h FORCE +u-boot.cfg spl/u-boot.cfg tpl/u-boot.cfg: $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.autoconf $(@) -include include/autoconf.mk @@ -910,7 +910,7 @@ quiet_cmd_cfgcheck = CFGCHK $2 cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \ $(srctree)/scripts/config_whitelist.txt $(srctree) -all: $(ALL-y) cfg +all: $(ALL-y) ifeq ($(CONFIG_DM_I2C_COMPAT)$(CONFIG_SANDBOX),y) @echo >&2 "===================== WARNING ======================" @echo >&2 "This board uses CONFIG_DM_I2C_COMPAT. Please remove" @@ -1549,7 +1549,7 @@ prepare0: archprepare FORCE $(Q)$(MAKE) $(build)=. # All the preparing.. -prepare: prepare0 +prepare: prepare0 cfg # Generate some files # ---------------------------------------------------------------------------