@@ -259,7 +259,8 @@ class SignatureGeneratorOEBasicHashMixIn(object):
if taskhash != unihash:
unihashmap[tid] = " " + self.lockedpnmap[fn] + ":" + task + ":" + taskhash + ":" + unihash
- with open(sigfile, "w") as f:
+ tmpfile = sigfile + ".new"
+ with open(tmpfile, "w") as f:
l = sorted(types)
for t in l:
f.write('SIGGEN_LOCKEDSIGS_%s = "\\\n' % t)
@@ -277,6 +278,7 @@ class SignatureGeneratorOEBasicHashMixIn(object):
for tid in sortedtid:
f.write(unihashmap[tid] + " \\\n")
f.write(' "\n')
+ os.rename(tmpfile, sigfile)
def dump_siglist(self, sigfile, path_prefix_strip=None):
def strip_fn(fn):
dump_lockedsigs() writes the sigfile in place, so if bitbake fails or is killed partway through, for example on a full disk, a truncated locked-sigs.inc is left behind. yocto-check-layer's test_signatures and test_machine_signatures run bitbake with -k and ignore its exit status when the file exists, so they would compare a partial set of signatures without noticing. Write to locked-sigs.inc.new and rename it into place once complete, as epochfile_write() in oe/reproducible.py does, so a failed dump leaves no sigfile behind. Tested by making dump_lockedsigs() fail with ENOSPC halfway through on meta-qcom data: yocto-check-layer previously accepted the partial file, now it reports the error. Complete output is byte-identical and a meta-qcom yocto-check-layer run gives the same results as before. AI-Generated: Uses Claude Code (Claude Opus 5.5) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com> --- meta/lib/oe/sstatesig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)