From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by mail.openembedded.org (Postfix) with ESMTP id A2FB578522 for ; Tue, 21 Nov 2017 08:18:35 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id vAL8IZti018963 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 21 Nov 2017 00:18:35 -0800 (PST) Received: from pek-hostel-deb02.wrs.com (128.224.153.152) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.361.1; Tue, 21 Nov 2017 00:18:35 -0800 From: To: , Date: Tue, 21 Nov 2017 16:00:54 +0800 Message-ID: <20171121080054.8326-1-mingli.yu@windriver.com> X-Mailer: git-send-email 2.13.3 MIME-Version: 1.0 Subject: [PATCH] glibc/gcc/libgcc-initial: Reimplement "deltask do_build" X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 08:18:35 -0000 Content-Type: text/plain From: Mingli Yu Previously, "deltask do_build" can result in the dependency of do_build lost and can trigger a race condition error as below when do_rm_work is enabled. ================================================= NOTE: recipe glibc-initial-2.26-r0: task do_fetch: Failed ERROR: glibc-initial-2.26-r0 do_fetch: Function failed: extend_recipe_sysroot The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: 0001: *** 0002:extend_recipe_sysroot(d) 0003: File: '$Prj/layers/oe-core/meta/classes/staging.bbclass', lineno: 410, function: extend_recipe_sysroot 0406: manifests = {} 0407: # All files that we're going to be installing, to find conflicts. 0408: fileset = {} 0409: *** 0410: for f in os.listdir(depdir): 0411: if not f.endswith(".complete"): 0412: continue 0413: f = depdir + "/" + f 0414: if os.path.islink(f) and not os.path.exists(f): Exception: FileNotFoundError: [Errno 2] No such file or directory: '$Prj/build/tmp-glibc/work/cortexa8hf-neon-wrs-linux-gnueabi/glibc-initial/2.26-r0/recipe-sysroot-native/installeddeps' ================================================= Rewrite the implementation of "deltask do_build" to save the dependency before deleting do_build task to avoid the race condition. [YOCTO #12365] Signed-off-by: Mingli Yu --- meta/recipes-core/glibc/glibc-initial.inc | 6 +++++- meta/recipes-devtools/gcc/gcc-cross-initial.inc | 6 +++++- meta/recipes-devtools/gcc/libgcc-initial.inc | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/meta/recipes-core/glibc/glibc-initial.inc b/meta/recipes-core/glibc/glibc-initial.inc index b86e2fb2db..4390b6dfca 100644 --- a/meta/recipes-core/glibc/glibc-initial.inc +++ b/meta/recipes-core/glibc/glibc-initial.inc @@ -54,4 +54,8 @@ do_siteconfig () { inherit nopackages # We really only want this built by things that need it, not any recrdeptask -deltask do_build +python () { + if bb.data.inherits_class('rm_work', d): + bb.build.exec_func("inject_rm_work", d) + bb.build.deltask('do_build', d) +} diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc index 892b1dbf2f..6c0b2eff86 100644 --- a/meta/recipes-devtools/gcc/gcc-cross-initial.inc +++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc @@ -86,4 +86,8 @@ COMPILERINITIAL = "-initial" # We really only want this built by things that need it, not any recrdeptask -deltask do_build +python () { + if bb.data.inherits_class('rm_work', d): + bb.build.exec_func("inject_rm_work", d) + bb.build.deltask('do_build', d) +} diff --git a/meta/recipes-devtools/gcc/libgcc-initial.inc b/meta/recipes-devtools/gcc/libgcc-initial.inc index 950ad861e7..cef8257052 100644 --- a/meta/recipes-devtools/gcc/libgcc-initial.inc +++ b/meta/recipes-devtools/gcc/libgcc-initial.inc @@ -17,4 +17,8 @@ COMPILERINITIAL = "-initial" inherit nopackages # We really only want this built by things that need it, not any recrdeptask -deltask do_build +python () { + if bb.data.inherits_class('rm_work', d): + bb.build.exec_func("inject_rm_work", d) + bb.build.deltask('do_build', d) +} -- 2.13.3