diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-09 15:56:19 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-17 08:52:28 +0000 |
commit | 2946c56b233370ac4b151558079f2fc676157bad (patch) | |
tree | 231e573d1a8a9edd3327c3ea8c533f28df8234b9 /bitbake/lib/bb/siggen.py | |
parent | 4754b1021ebdc8272b324bb8f2ffff03c8719233 (diff) | |
download | poky-2946c56b233370ac4b151558079f2fc676157bad.tar.gz |
bitbake: bitbake: siggen/runqueue: Switch to using RECIPE_SIGGEN_INFO feature for signature dumping
Now that we have cache support for the taskdep/gendep/lookupcache data,
we can switch to use that cooker feature and skip the secondary reparse to
write the sig files. This does make the initial parse longer but means the
secondary one isn't needed.
At present parsing with the larger cache isn't optimal but we have plans
in place which will make this faster than the current reparse code being
removed here.
(Bitbake rev: 5951b5b56449855bc2a30146af65eb287a35fcef)
(Bitbake rev: 1252e5bce51ae912ecff9dcc354a371786ff2c72)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r-- | bitbake/lib/bb/siggen.py | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index e57f1ffe69..6b73843c67 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
@@ -335,8 +335,8 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
335 | self.unihash_cache.copyfile(targetdir) | 335 | self.unihash_cache.copyfile(targetdir) |
336 | 336 | ||
337 | def dump_sigtask(self, fn, task, stampbase, runtime): | 337 | def dump_sigtask(self, fn, task, stampbase, runtime): |
338 | |||
339 | tid = fn + ":" + task | 338 | tid = fn + ":" + task |
339 | mc = bb.runqueue.mc_from_tid(fn) | ||
340 | referencestamp = stampbase | 340 | referencestamp = stampbase |
341 | if isinstance(runtime, str) and runtime.startswith("customfile"): | 341 | if isinstance(runtime, str) and runtime.startswith("customfile"): |
342 | sigfile = stampbase | 342 | sigfile = stampbase |
@@ -353,16 +353,27 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
353 | data['task'] = task | 353 | data['task'] = task |
354 | data['basehash_ignore_vars'] = self.basehash_ignore_vars | 354 | data['basehash_ignore_vars'] = self.basehash_ignore_vars |
355 | data['taskhash_ignore_tasks'] = self.taskhash_ignore_tasks | 355 | data['taskhash_ignore_tasks'] = self.taskhash_ignore_tasks |
356 | data['taskdeps'] = self.taskdeps[fn][task] | 356 | if hasattr(self, "datacaches"): |
357 | data['taskdeps'] = self.datacaches[mc].siggen_taskdeps[fn][task] | ||
358 | else: | ||
359 | data['taskdeps'] = self.taskdeps[fn][task] | ||
357 | data['basehash'] = self.basehash[tid] | 360 | data['basehash'] = self.basehash[tid] |
358 | data['gendeps'] = {} | 361 | data['gendeps'] = {} |
359 | data['varvals'] = {} | 362 | data['varvals'] = {} |
360 | data['varvals'][task] = self.lookupcache[fn][task] | 363 | if hasattr(self, "datacaches"): |
361 | for dep in self.taskdeps[fn][task]: | 364 | data['varvals'][task] = self.datacaches[mc].siggen_varvals[fn][task] |
362 | if dep in self.basehash_ignore_vars: | 365 | for dep in self.datacaches[mc].siggen_taskdeps[fn][task]: |
363 | continue | 366 | if dep in self.basehash_ignore_vars: |
364 | data['gendeps'][dep] = self.gendeps[fn][dep] | 367 | continue |
365 | data['varvals'][dep] = self.lookupcache[fn][dep] | 368 | data['gendeps'][dep] = self.datacaches[mc].siggen_gendeps[fn][dep] |
369 | data['varvals'][dep] = self.datacaches[mc].siggen_varvals[fn][dep] | ||
370 | else: | ||
371 | data['varvals'][task] = self.lookupcache[fn][task] | ||
372 | for dep in self.taskdeps[fn][task]: | ||
373 | if dep in self.basehash_ignore_vars: | ||
374 | continue | ||
375 | data['gendeps'][dep] = self.gendeps[fn][dep] | ||
376 | data['varvals'][dep] = self.lookupcache[fn][dep] | ||
366 | 377 | ||
367 | if runtime and tid in self.taskhash: | 378 | if runtime and tid in self.taskhash: |
368 | data['runtaskdeps'] = self.runtaskdeps[tid] | 379 | data['runtaskdeps'] = self.runtaskdeps[tid] |
@@ -409,18 +420,6 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
409 | pass | 420 | pass |
410 | raise err | 421 | raise err |
411 | 422 | ||
412 | def dump_sigfn(self, fn, dataCaches, options): | ||
413 | if fn in self.taskdeps: | ||
414 | for task in self.taskdeps[fn]: | ||
415 | tid = fn + ":" + task | ||
416 | mc = bb.runqueue.mc_from_tid(tid) | ||
417 | if tid not in self.taskhash: | ||
418 | continue | ||
419 | if dataCaches[mc].basetaskhash[tid] != self.basehash[tid]: | ||
420 | bb.error("Bitbake's cached basehash does not match the one we just generated (%s)!" % tid) | ||
421 | bb.error("The mismatched hashes were %s and %s" % (dataCaches[mc].basetaskhash[tid], self.basehash[tid])) | ||
422 | self.dump_sigtask(fn, task, dataCaches[mc].stamp[fn], True) | ||
423 | |||
424 | class SignatureGeneratorBasicHash(SignatureGeneratorBasic): | 423 | class SignatureGeneratorBasicHash(SignatureGeneratorBasic): |
425 | name = "basichash" | 424 | name = "basichash" |
426 | 425 | ||