[oe-commits] [bitbake] 01/01: fix?

git at git.openembedded.org git at git.openembedded.org
Tue Dec 3 11:48:13 UTC 2019


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

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

commit 7204fd957b0b00eb5efa0a2b141a75ca357c49c2
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Dec 2 17:52:37 2019 +0000

    fix?
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/runqueue.py | 23 ++++++++++++++++++-----
 lib/bb/siggen.py   | 29 +++++++++++++++++------------
 2 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 038c54e..2813462 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -2284,17 +2284,28 @@ class RunQueueExecute:
                         for dep in self.rqdata.runtaskentries[tid].depends:
                             procdep.append(dep)
                         orighash = self.rqdata.runtaskentries[tid].hash
-                        self.rqdata.runtaskentries[tid].hash = bb.parse.siggen.get_taskhash(tid, procdep, self.rqdata.dataCaches[mc_from_tid(tid)])
+                        newhash = bb.parse.siggen.get_taskhash(tid, procdep, self.rqdata.dataCaches[mc_from_tid(tid)])
                         origuni = self.rqdata.runtaskentries[tid].unihash
-                        self.rqdata.runtaskentries[tid].unihash = bb.parse.siggen.get_unihash(tid)
-                        self.rehashes[tid] = origuni
+                        newuni = bb.parse.siggen.get_unihash(tid)
+                        # FIXME, need to check it can come from sstate at all for determinism?
+                        remapped = False
+                        if tid in self.scenequeue_covered or tid in self.sq_live:
+                            # Already ran this setscene task or it running
+                            remapped = bb.parse.siggen.report_unihash_equiv(tid, origuni, newuni, self.rqdata.dataCaches)
+                            logger.info("Already covered setscene for %s so ignoring rehash" % (tid))
+                        if not remapped:
+                            logger.debug(1, "Task %s hash changes: %s->%s %s->%s" % (tid, orighash, self.rqdata.runtaskentries[tid].hash, origuni, self.rqdata.runtaskentries[tid].unihash))
+                            self.rqdata.runtaskentries[tid].hash = newhash
+                            self.rqdata.runtaskentries[tid].unihash = newuni
+                            self.rehashes[tid] = origuni
+                            changed.add(tid)
+
                         #if orighash == self.rqdata.runtaskentries[tid].hash and origuni == self.rqdata.runtaskentries[tid].unihash:
                             #logger.info("Task hash didn't change for: %s" % (tid))
                         #    continue
                         #else:
-                        logger.debug(1, "Task %s hash changes: %s->%s %s->%s" % (tid, orighash, self.rqdata.runtaskentries[tid].hash, origuni, self.rqdata.runtaskentries[tid].unihash))
+
                         next |= self.rqdata.runtaskentries[tid].revdeps
-                        changed.add(tid)
                         total.remove(tid)
                         next.intersection_update(total)
 
@@ -2524,6 +2535,8 @@ class RunQueueExecute:
                 msg = 'Task %s.%s attempted to execute unexpectedly and should have been setscened' % (pn, taskname)
             else:
                 msg = 'Task %s.%s attempted to execute unexpectedly' % (pn, taskname)
+            for t in self.scenequeue_notcovered:
+                msg = msg + "\nTask %s, unihash %s, taskhash %s" % (t, self.rqdata.runtaskentries[t].unihash, self.rqdata.runtaskentries[t].hash)
             logger.error(msg + '\nThis is usually due to missing setscene tasks. Those missing in this build were: %s' % pprint.pformat(self.scenequeue_notcovered))
             return True
         return False
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 3d0be35..bc91203 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -525,21 +525,25 @@ class SignatureGeneratorUniHashMixIn(object):
                 except OSError:
                     pass
 
-    def report_unihash_equiv(self, tid, unihash, newunihash, datacaches):
+    def report_unihash_equiv(self, tid, oldunihash, newunihash, datacaches):
         try:
             extra_data = {}
-            data = self.client().report_unihash_equiv(newunihash, self.method, unihash, extra_data)
-            bb.warn('Reported task %s as unihash %s to %s (%s)' % (tid, newunihash, self.server, str(data)))
-
-            # FIXME, only rename if there is an upstream hash?
-            (mc, fn, taskname, taskfn) = bb.runqueue.split_tid_mcfn(tid)
-            stamp = bb.build.stampfile(taskname + "_setscene", datacaches[mc], taskfn, noextra=True)
-            oldstamp = stamp.replace(newunihash, unihash)
-            if os.path.exists(oldstamp):
-                bb.note("Renaming %s to %s" % (oldstamp, stamp))
-                os.rename(oldstamp, stamp)
+            data = self.client().report_unihash_equiv(newunihash, self.method, oldunihash, extra_data)
+            bb.note('Reported task %s as unihash %s to %s (%s)' % (tid, newunihash, self.server, str(data)))
+
+            if data is None:
+                bb.warn("Server unable to handle unihash report")
+                return
+
+            finalunihash = data['unihash']
+
+            if newunihash != finalunihash:
+                bb.note('Task %s unihash changed %s -> %s (%s)' % (tid, newunihash, finalunihash, oldunihash))
+                self.set_unihash(tid, finalunihash)
+                return True
             else:
-                bb.note("Not renaming %s to %s" % (oldstamp, stamp))
+                bb.note('Task %s unihash %s unchanged by server' % (tid, finalunihash))
+                return False
 
         except hashserv.client.HashConnectionError as e:
             bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e)))
@@ -938,3 +942,4 @@ def dump_sigfile(a):
     output.append("Computed task hash is %s" % computed_taskhash)
 
     return output
+

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


More information about the Openembedded-commits mailing list