summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-29 14:28:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-06 11:21:31 +0100
commit40eb5b344b4de5310a89e36024b826fc99484747 (patch)
tree1310401cf6716caa2d331f37ee5408fc9eb5f2e2
parentde143e0db64400d252b6500c3f4335091fcce6a1 (diff)
downloadopenembedded-core-contrib-40eb5b344b4de5310a89e36024b826fc99484747.tar.gz
openembedded-core-contrib-40eb5b344b4de5310a89e36024b826fc99484747.tar.bz2
openembedded-core-contrib-40eb5b344b4de5310a89e36024b826fc99484747.zip
bitbake: siggen: Convert to use self.unitaskhashes
Rather than metadata driven sqlite databases for communication, use bitbake's unitaskhashes variable instead. (Bitbake rev: a0d941c787cf3ef030d190903279d311bc05d752) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/siggen.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 2bb0b68527..368209807f 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -388,12 +388,15 @@ class SignatureGeneratorUniHashMixIn(object):
# If a unique hash is reported, use it as the stampfile hash. This
# ensures that if a task won't be re-run if the taskhash changes,
# but it would result in the same output hash
- unihash = self.unihashes.get(self.__get_task_unihash_key(task))
+ unihash = self.unitaskhashes.get(self.__get_task_unihash_key(task), None)
if unihash is not None:
return unihash
return super().get_stampfile_hash(task)
+ def set_unihash(self, task, unihash):
+ self.unitaskhashes[self.__get_task_unihash_key(task)] = unihash
+
def get_unihash(self, task):
import urllib
import json
@@ -404,7 +407,7 @@ class SignatureGeneratorUniHashMixIn(object):
# TODO: This cache can grow unbounded. It probably only needs to keep
# for each task
- unihash = self.unihashes.get(key)
+ unihash = self.unitaskhashes.get(key, None)
if unihash is not None:
return unihash
@@ -446,7 +449,7 @@ class SignatureGeneratorUniHashMixIn(object):
except (KeyError, json.JSONDecodeError) as e:
bb.warn('Poorly formatted response from %s: %s' % (self.server, str(e)))
- self.unihashes[key] = unihash
+ self.unitaskhashes[key] = unihash
return unihash
def report_unihash(self, path, task, d):
@@ -464,7 +467,7 @@ class SignatureGeneratorUniHashMixIn(object):
key = fn + '.do_' + task + ':' + taskhash
# Sanity checks
- cache_unihash = self.unihashes.get(key)
+ cache_unihash = self.unitaskhashes.get(key, None)
if cache_unihash is None:
bb.fatal('%s not in unihash cache. Please report this error' % key)
@@ -515,6 +518,7 @@ class SignatureGeneratorUniHashMixIn(object):
if new_unihash != unihash:
bb.debug(1, 'Task %s unihash changed %s -> %s by server %s' % (taskhash, unihash, new_unihash, self.server))
+ bb.event.fire(bb.runqueue.taskUniHashUpdate(fn + ':do_' + task, new_unihash), d)
else:
bb.debug(1, 'Reported task %s as unihash %s to %s' % (taskhash, unihash, self.server))
except urllib.error.URLError as e: