[oe-commits] [openembedded-core] 04/04: sstate: Avoid races over rewritten siginfo files

git at git.openembedded.org git at git.openembedded.org
Mon Jan 6 12:51:56 UTC 2020


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 20a914149927914006b0da6061521c7ce00da21e
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Jan 6 10:08:46 2020 +0000

    sstate: Avoid races over rewritten siginfo files
    
    Try and avoid errors like:
    
    Exception: bb.process.ExecutionError: Execution of 'build/tmp/work/x86_64-linux/libxslt-native/1.1.34-r0/temp/run.sstate_unpack_package.12343' failed with exit code 1:
    touch: setting times of 'build/sstate_devtool/80/4d/sstate:libxslt-native::1.1.34:r0::3:804d33f3f8d032b01ae92207669dd0a8f95a84917d563d122a77df19e786d73c_populate_lic.tgz.siginfo': Stale file handle
    WARNING: exit code 1 from a shell command.
    
    by not overwriting existing files.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/sstate.bbclass | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 241dace..356fe7e 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -686,7 +686,11 @@ def sstate_package(ss, d):
         bb.build.exec_func(f, d, (sstatebuild,))
 
     # SSTATE_PKG may have been changed by sstate_report_unihash
-    bb.siggen.dump_this_task(d.getVar('SSTATE_PKG') + ".siginfo", d)
+    siginfo = d.getVar('SSTATE_PKG') + ".siginfo"
+    if not os.path.exists(siginfo):
+        bb.siggen.dump_this_task(siginfo, d)
+    else:
+        os.utime(siginfo, None)
 
     return
 
@@ -1110,8 +1114,11 @@ python sstate_eventhandler() {
             d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}")
             d.setVar("SSTATE_EXTRAPATH", "")
         d.setVar("SSTATE_CURRTASK", taskname)
-        sstatepkg = d.getVar('SSTATE_PKG')
-        bb.siggen.dump_this_task(sstatepkg + ".siginfo", d)
+        siginfo = d.getVar('SSTATE_PKG') + ".siginfo"
+        if not os.path.exists(siginfo):
+            bb.siggen.dump_this_task(siginfo, d)
+        else:
+            os.utime(siginfo, None)
 }
 
 SSTATE_PRUNE_OBSOLETEWORKDIR ?= "1"

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


More information about the Openembedded-commits mailing list