diff mbox series

[RFC,06/10] lib/oe/sstatesig.py: add an option to make a unihash cache copy

Message ID 20240223120134.3713127-6-alex@linutronix.de
State New
Headers show
Series [RFC,01/10] scripts/oe-setup-build: write a build environment initialization one-liner into the build directory | expand

Commit Message

Alexander Kanavin Feb. 23, 2024, 12:01 p.m. UTC
This is already performed in eSDK creation; the change allows also
making a copy with a standalone 'bitbake -S unihash-cache-copy targets...'
command, which is useful for replicating builds on a different build host
(simply coping sstate objects is not enough if they need to be discovered
through unihash redirections).

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/lib/oe/sstatesig.py | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index aa891ecf0a0..e2582917fbd 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -146,6 +146,10 @@  class SignatureGeneratorOEBasicHashMixIn(object):
             sigfile = os.getcwd() + "/locked-sigs.inc"
             bb.plain("Writing locked sigs to %s" % sigfile)
             self.dump_lockedsigs(sigfile)
+        if 'unihash-cache-copy' in options:
+            cachefile = os.getcwd() + "/bb_unihashes.dat"
+            bb.plain("Writing unihash cache to %s" % cachefile)
+            bb.parse.siggen.copy_unitaskhashes(os.getcwd())
         return super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigs(dataCache, options)