From patchwork Thu Jan 10 14:11:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 155177 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1941418jaa; Thu, 10 Jan 2019 06:13:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN5j2ql6UMYfgXPTNS3uRsEHBCka1xNnOghhVldS9D2gUKK1Mtqw55m6g2yAkDSUmSKLvbkw X-Received: by 2002:a17:906:f24a:: with SMTP id gy10-v6mr8564369ejb.64.1547129608546; Thu, 10 Jan 2019 06:13:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547129608; cv=none; d=google.com; s=arc-20160816; b=Wy80aCDG2nX2t76Kzu50oOxIVq2826lBRqr4fj6krDNrLUEXq5TxDwVb6W7rRopU5u RxmcieVwOrkOk2U4b981UIufDUl3JRj+EbLWFa0kfsfKMDiPrXakII6WixhHU7C5P0yB 1w6iDXMVrmgPhwlqCKWYOsjL41pInGl2ZkhakPuouz37wg33fwCk9Yko7ee+1b7GgmZt y4aLtdxKmL9TCy01PbCg7/i9/eITjQOzchpL7ykPuz9+OhcHeprAugN72MLQGNSZW1g6 +L+LhGu3ManQcpyEp6Ik2NkAqZQpSMm9iBKhuyCYp23M9c48CEkNjh6PwWOZoKoiH5nc Ho9w== 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=LtIhEanD/9baTYZU3HyCi2+Ce1AvH7EGZtBGrWywagY=; b=KZWpwZwpNX5tRPlxlItT/CXcvNILn2Nm9HfGJo3K1uW1Z2TEJfCMey3k+hVvh4Kdn5 pHOQODK1pbtCzDQ9I3khlpk84BcHXayop/FJzrULPTVP7PUZs8mh7HicdDcYxe5mhxEX 0LhOScYXs/Emc+a8CDS7IXky1M2ksD7KAUP6ceYr4q7sQHAKk/Nt4MLLv/IavL3c9bdb xmD0OG0EjQYKQMbRgeQtdVz+ltswCYPyFu8bNARdMfYS7c26z0jr3dI7sL0Og83K5xUq QcnXFmQBBwIl4MR1quU4fcWZ97cE0JNtV8q6RDv5JkCuUFb/WW/RdNunf/L4ypQEGrfN +GsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=RLUdgRml; 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 j11-v6si298605ejk.263.2019.01.10.06.13.28; Thu, 10 Jan 2019 06:13:28 -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=RLUdgRml; 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 18768C220EA; Thu, 10 Jan 2019 14:13:04 +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, RCVD_IN_MSPIKE_H2, 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 9AFDCC220A6; Thu, 10 Jan 2019 14:13:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7750DC220F7; Thu, 10 Jan 2019 14:12:44 +0000 (UTC) Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by lists.denx.de (Postfix) with ESMTPS id DB134C220D9 for ; Thu, 10 Jan 2019 14:12:39 +0000 (UTC) Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-10.nifty.com with ESMTP id x0AEBiud019568; Thu, 10 Jan 2019 23:11:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x0AEBiud019568 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1547129505; bh=2YBzBPhOjyeB8eCUp+okREgSGxaxwSca7cVrLLNiwv4=; h=From:To:Cc:Subject:Date:From; b=RLUdgRmlae3Z4Ky3nBUUpcZfdfDISO6gbaFHCbAPQyTvX46jlSfFXwj+9q+FPbutA rKqezlY8P7AWctapLyoCoG+kU5uKjEH1CAtjIgo9Lm8FQk07wYGJIn+bGexN//S/XM yYK6Y6V1nko1dJ45Iyk1W3Xelw5FEzf5bCC+/eb+bk3rAau9V8d32NoOSMUxys2heh pS7X/G/Tlg4yM97Iz+qqEmqY+YsQbvTIoNqdJSwepHlfOsLchvQfmXRjpqbiknqL3C yT/cLeQfBLrayTXfAUTZn7RjgWOX9MMpeAxR8ACaI5iWhNQwQZZ54UAM4CIs4y/OWv Rq2qrJOeCmbVw== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 10 Jan 2019 23:11:39 +0900 Message-Id: <1547129499-20373-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Cc: Baruch Siach , Ryder Lee , Stephen Warren , Richard Purdie , Chris Packham Subject: [U-Boot] [PATCH v2] 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 full 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, let's 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 --- Changes in v2: - Move 'cfg' before 'prepare0' to avoid a race between them Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index eeb299f..c6eb727 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" @@ -1530,7 +1530,7 @@ ifneq ($(KBUILD_SRC),) endif # prepare2 creates a makefile if using a separate output directory -prepare2: prepare3 outputmakefile +prepare2: prepare3 outputmakefile cfg prepare1: prepare2 $(version_h) $(timestamp_h) \ include/config/auto.conf