[oe-commits] [openembedded-core] 18/18: package: Fix race between do_package and do_packagedata

git at git.openembedded.org git at git.openembedded.org
Fri Aug 16 16:13:05 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 98c1380c9625e4fd0e47cac24948759a838b822d
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Thu Aug 15 21:55:16 2019 +0100

    package: Fix race between do_package and do_packagedata
    
    do_package has PKGDESTWORK as a cleandir and do_packagedata has it as an sstate-input
    dir. This means do_package wipes out the directory at both do_package and do_package_setscene.
    
    do_package_setscene and do_packagedata_setscene can run in parallel when installing from
    sstate which means they can wipe out parts of each other leading to interesting
    build failures.
    
    We therefore have to add in a hardlink copy so that the directories can work independently
    of each other.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/package.bbclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index e67bb5b..114d655 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -2252,14 +2252,18 @@ python do_package_setscene () {
 }
 addtask do_package_setscene
 
-do_packagedata () {
-	:
+# Copy from PKGDESTWORK to tempdirectory as tempdirectory can be cleaned at both
+# do_package_setscene and do_packagedata_setscene leading to races
+python do_packagedata () {
+    src = d.expand("${PKGDESTWORK}")
+    dest = d.expand("${WORKDIR}/pkgdata-pdata-input")
+    oe.path.copyhardlinktree(src, dest)
 }
 
 addtask packagedata before do_build after do_package
 
 SSTATETASKS += "do_packagedata"
-do_packagedata[sstate-inputdirs] = "${PKGDESTWORK}"
+do_packagedata[sstate-inputdirs] = "${WORKDIR}/pkgdata-pdata-input"
 do_packagedata[sstate-outputdirs] = "${PKGDATA_DIR}"
 do_packagedata[stamp-extra-info] = "${MACHINE_ARCH}"
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list