summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-05 11:38:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-05 11:59:08 +0000
commit859786a83f8bb826d3cd89c08bd9596fc7cf2474 (patch)
treed69e873b6fd4abe18fd559cf90221986869ae3ef
parentcc85c8eb9d96e91a7767e92c86f0d7f2960b093b (diff)
downloadpoky-859786a83f8bb826d3cd89c08bd9596fc7cf2474.tar.gz
bitbake: siggen: Ensure version of siggen is verified
Since we need to change the form of the siggen function, we need to add versioning and some verison checks. This means if a newer bitbake is used with older metadata we can detect it. (Bitbake rev: 721556568413508213d22c29985e305a45a8d68a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/command.py1
-rw-r--r--bitbake/lib/bb/runqueue.py1
-rw-r--r--bitbake/lib/bb/siggen.py10
3 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 79b6c0738f..1fcb9bf14c 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -777,6 +777,7 @@ class CommandsAsync:
777 (mc, pn) = bb.runqueue.split_mc(params[0]) 777 (mc, pn) = bb.runqueue.split_mc(params[0])
778 taskname = params[1] 778 taskname = params[1]
779 sigs = params[2] 779 sigs = params[2]
780 bb.siggen.check_siggen_version(bb.siggen)
780 res = bb.siggen.find_siginfo(pn, taskname, sigs, command.cooker.databuilder.mcdata[mc]) 781 res = bb.siggen.find_siginfo(pn, taskname, sigs, command.cooker.databuilder.mcdata[mc])
781 bb.event.fire(bb.event.FindSigInfoResult(res), command.cooker.databuilder.mcdata[mc]) 782 bb.event.fire(bb.event.FindSigInfoResult(res), command.cooker.databuilder.mcdata[mc])
782 command.finishAsyncCommand() 783 command.finishAsyncCommand()
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index d61dfbb691..110865132d 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1749,6 +1749,7 @@ class RunQueue:
1749 return invalidtasks.difference(found) 1749 return invalidtasks.difference(found)
1750 1750
1751 def write_diffscenetasks(self, invalidtasks): 1751 def write_diffscenetasks(self, invalidtasks):
1752 bb.siggen.check_siggen_version(bb.siggen)
1752 1753
1753 # Define recursion callback 1754 # Define recursion callback
1754 def recursecb(key, hash1, hash2): 1755 def recursecb(key, hash1, hash2):
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index b023b79eca..5a584cadf9 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -24,6 +24,16 @@ import hashserv.client
24logger = logging.getLogger('BitBake.SigGen') 24logger = logging.getLogger('BitBake.SigGen')
25hashequiv_logger = logging.getLogger('BitBake.SigGen.HashEquiv') 25hashequiv_logger = logging.getLogger('BitBake.SigGen.HashEquiv')
26 26
27#find_siginfo and find_siginfo_version are set by the metadata siggen
28# The minimum version of the find_siginfo function we need
29find_siginfo_minversion = 2
30
31def check_siggen_version(siggen):
32 if not hasattr(siggen, "find_siginfo_version"):
33 bb.fatal("Siggen from metadata (OE-Core?) is too old, please update it (no version found)")
34 if siggen.find_siginfo_version < siggen.find_siginfo_minversion:
35 bb.fatal("Siggen from metadata (OE-Core?) is too old, please update it (%s vs %s)" % (siggen.find_siginfo_version, siggen.find_siginfo_minversion))
36
27class SetEncoder(json.JSONEncoder): 37class SetEncoder(json.JSONEncoder):
28 def default(self, obj): 38 def default(self, obj):
29 if isinstance(obj, set) or isinstance(obj, frozenset): 39 if isinstance(obj, set) or isinstance(obj, frozenset):