aboutsummaryrefslogtreecommitdiffstats
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:05 +0000
commit721556568413508213d22c29985e305a45a8d68a (patch)
treefedbf09cabda7d705cf0a994a13c96e1b7539ff5
parent5439aca056c84ab4410aaf24bdb68e896191d8e1 (diff)
downloadbitbake-721556568413508213d22c29985e305a45a8d68a.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/command.py1
-rw-r--r--lib/bb/runqueue.py1
-rw-r--r--lib/bb/siggen.py10
3 files changed, 12 insertions, 0 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py
index 79b6c0738..1fcb9bf14 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -777,6 +777,7 @@ class CommandsAsync:
(mc, pn) = bb.runqueue.split_mc(params[0])
taskname = params[1]
sigs = params[2]
+ bb.siggen.check_siggen_version(bb.siggen)
res = bb.siggen.find_siginfo(pn, taskname, sigs, command.cooker.databuilder.mcdata[mc])
bb.event.fire(bb.event.FindSigInfoResult(res), command.cooker.databuilder.mcdata[mc])
command.finishAsyncCommand()
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index d61dfbb69..110865132 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1749,6 +1749,7 @@ class RunQueue:
return invalidtasks.difference(found)
def write_diffscenetasks(self, invalidtasks):
+ bb.siggen.check_siggen_version(bb.siggen)
# Define recursion callback
def recursecb(key, hash1, hash2):
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index b023b79ec..5a584cadf 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -24,6 +24,16 @@ import hashserv.client
logger = logging.getLogger('BitBake.SigGen')
hashequiv_logger = logging.getLogger('BitBake.SigGen.HashEquiv')
+#find_siginfo and find_siginfo_version are set by the metadata siggen
+# The minimum version of the find_siginfo function we need
+find_siginfo_minversion = 2
+
+def check_siggen_version(siggen):
+ if not hasattr(siggen, "find_siginfo_version"):
+ bb.fatal("Siggen from metadata (OE-Core?) is too old, please update it (no version found)")
+ if siggen.find_siginfo_version < siggen.find_siginfo_minversion:
+ bb.fatal("Siggen from metadata (OE-Core?) is too old, please update it (%s vs %s)" % (siggen.find_siginfo_version, siggen.find_siginfo_minversion))
+
class SetEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, set) or isinstance(obj, frozenset):