[OE-core] [PATCH] archive: fix racing between do_ar_patched and do_kernel_configme

Hongxu Jia hongxu.jia at windriver.com
Thu Jul 25 08:21:07 UTC 2019


While archive mode is 'patched', there is a probably racing between
do_ar_patched and do_kernel_configme
[snip]
|File: 'oe-core/meta/classes/archiver.bbclass', lineno: 313, function: create_tarball
...
|Exception: FileNotFoundError: [Errno 2] No such file or directory: 'build/
tmp-glibc/work-shared/qemux86-64/kernel-source/.tmp.config.DCUH7mUNe3'
[snip]

Task do_kernel_configme will modify ${S}, and it broke create_tarball in
do_ar_patched.

Order do_kernel_configme and do_ar_patched to avoid racing.

Also improve sstatesig.py to respect commit [fed0ed8 archiver.bbclass: do
not cause kernel rebuilds]

Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
---
 meta/classes/archiver.bbclass | 8 ++++++--
 meta/lib/oe/sstatesig.py      | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index af9f010..72ce34a 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -487,7 +487,11 @@ python () {
     # Add tasks in the correct order, specifically for linux-yocto to avoid race condition.
     # sstatesig.py:sstate_rundepfilter has special support that excludes this dependency
     # so that do_kernel_configme does not need to run again when do_unpack_and_patch
-    # gets added or removed (by adding or removing archiver.bbclass).
+    # or do_ar_patched gets added or removed (by adding or removing archiver.bbclass).
     if bb.data.inherits_class('kernel-yocto', d):
-        bb.build.addtask('do_kernel_configme', 'do_configure', 'do_unpack_and_patch', d)
+        ar_src = d.getVarFlag('ARCHIVER_MODE', 'src')
+        if ar_src == "patched":
+            bb.build.addtask('do_kernel_configme', 'do_configure', 'do_ar_patched', d)
+        else:
+            bb.build.addtask('do_kernel_configme', 'do_configure', 'do_unpack_and_patch', d)
 }
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 13af16e..b1b9c39 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -28,7 +28,8 @@ def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCache):
     # The exception is the special do_kernel_configme->do_unpack_and_patch
     # dependency from archiver.bbclass.
     if recipename == depname:
-        if task == "do_kernel_configme" and dep.endswith(".do_unpack_and_patch"):
+        if task == "do_kernel_configme" and (dep.endswith(".do_unpack_and_patch") or \
+                                             dep.endswith(".do_ar_patched")):
             return False
         return True
 
-- 
2.8.1



More information about the Openembedded-core mailing list