Skip to contentSkip to conversation

siggen: Avoid taskhash mismatch errors for nostamp tasks when dependencies rehash

PATCH In review Richard Purdie 2 participants 3 messages Dec 5, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 siggen: Avoid taskhash mismatch errors for nostamp tasks when dependencies rehash

An example:

NOTE: recipe binutils-cross-testsuite-2.32.0-r0: task do_check: Started
ERROR: Taskhash mismatch b074da4334aff8aa06572e7a8725c941fa6b08de4ce714a65a90c0c0b680abea versus 17375278daed609a7129769b74a1336a37bdef14b534ae85189ccc033a9f2db4 for /home/pokybuild/yocto-worker/qemux86-64/build/meta/recipes-devtools/binutils/binutils-cross-testsuite_2.32.bb:do_check
NOTE: recipe binutils-cross-testsuite-2.32.0-r0: task do_check: Succeeded

Is caused by a rehash in a dependency happening somewhere earlier in the build and the taint being reset.

Change the code so that nostamp taints are preserved to avoid the issue.

---
 lib/bb/siggen.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
lib/bb/siggen.py +8 -4
index edf10105f9..de85326872 100644
@@ -232,10 +232,14 @@ class SignatureGeneratorBasic(SignatureGenerator):
         taskdep = dataCache.task_deps[fn]
         if 'nostamp' in taskdep and task in taskdep['nostamp']:
             # Nostamp tasks need an implicit taint so that they force any dependent tasks to run
-            import uuid
-            taint = str(uuid.uuid4())
-            data = data + taint
-            self.taints[tid] = "nostamp:" + taint
+            if tid in self.taints and self.taints[tid].startswith("nostamp:"):
+                # Don't reset taint value upon every call
+                data = data + self.taints[tid][8:]
+            else:
+                import uuid
+                taint = str(uuid.uuid4())
+                data = data + taint
+                self.taints[tid] = "nostamp:" + taint
 
         taint = self.read_taint(fn, task, dataCache.stamp[fn])
         if taint:
Signature · 1 line
2.20.1
#1 lore raw

I don't have the context of this, but the question popped into my mind.

Is there a way that the system can clear the tainted hash? (i.e. on a memory
resident bitbake over multiple builds for instance)

Or is this not an issue, since these reset for each build, and it's only in memory?

--Mark

Quoted 40 lines · Richard Purdie

An example:

NOTE: recipe binutils-cross-testsuite-2.32.0-r0: task do_check: Started
ERROR: Taskhash mismatch b074da4334aff8aa06572e7a8725c941fa6b08de4ce714a65a90c0c0b680abea versus 17375278daed609a7129769b74a1336a37bdef14b534ae85189ccc033a9f2db4 for /home/pokybuild/yocto-worker/qemux86-64/build/meta/recipes-devtools/binutils/binutils-cross-testsuite_2.32.bb:do_check
NOTE: recipe binutils-cross-testsuite-2.32.0-r0: task do_check: Succeeded

Is caused by a rehash in a dependency happening somewhere earlier in the build and the taint being reset.

Change the code so that nostamp taints are preserved to avoid the issue.

---
 lib/bb/siggen.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
lib/bb/siggen.py +8 -4
index edf10105f9..de85326872 100644
@@ -232,10 +232,14 @@ class SignatureGeneratorBasic(SignatureGenerator):
         taskdep = dataCache.task_deps[fn]
         if 'nostamp' in taskdep and task in taskdep['nostamp']:
             # Nostamp tasks need an implicit taint so that they force any dependent tasks to run
-            import uuid
-            taint = str(uuid.uuid4())
-            data = data + taint
-            self.taints[tid] = "nostamp:" + taint
+            if tid in self.taints and self.taints[tid].startswith("nostamp:"):
+                # Don't reset taint value upon every call
+                data = data + self.taints[tid][8:]
+            else:
+                import uuid
+                taint = str(uuid.uuid4())
+                data = data + taint
+                self.taints[tid] = "nostamp:" + taint
 
         taint = self.read_taint(fn, task, dataCache.stamp[fn])
         if taint:
#2 lore raw
Quoted 9 lines · Mark Hatle

I don't have the context of this, but the question popped into my mind.

Is there a way that the system can clear the tainted hash? (i.e. on
a memory
resident bitbake over multiple builds for instance)

Or is this not an issue, since these reset for each build, and it's only in memory?

This data is part of the runqueue so its only relevant for a given build.

Cheers,

Richard