<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14774</bug_id>
          
          <creation_ts>2022-04-05 23:37:08 +0000</creation_ts>
          <short_desc>Fatal Error when running bitbake --dump-signatures=printdiff in an initramfs multiconfig environment</short_desc>
          <delta_ts>2022-05-09 11:23:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>4.1 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gregory Lumen">gregorylumen</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>gregorylumen</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>92924</commentid>
    <comment_count>0</comment_count>
    <who name="Gregory Lumen">gregorylumen</who>
    <bug_when>2022-04-05 23:37:08 +0000</bug_when>
    <thetext>I am building a multiconfig with an initramfs config alongside the normal device config.

Each config has a separate TMPDIR.

The device config includes:
  INITRAMFS_IMAGE_BUNDLE = &quot;1&quot;
  INITRAMFS_IMAGE = &quot;core-image-tiny-initramfs&quot;`

Where core-image-tiny-initramfs is built as part of the initramfs config.

When I attempt to run `bitbake --dump-signatures=printdiff device-image` it hits the following fatal error:

  ERROR: Can&apos;t find a task we&apos;re supposed to have written out? (hash: &lt;hash&gt;)?

Where the hash corresponds to the signature for the `core-image-tiny-initramfs:do_rootfs` task.

Based on my limited debugging so far, it appears that `print_diffscenetasks` (poky\bitbake\lib\bb\runqueue.py) is searching under the TMPDIR for the device config, yet the stampsfile is being correctly generated under the TMPDIR for the initramfs config.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92935</commentid>
    <comment_count>1</comment_count>
    <who name="Gregory Lumen">gregorylumen</who>
    <bug_when>2022-04-06 16:45:32 +0000</bug_when>
    <thetext>The following patch appears to at least partially fix the issue (though I&apos;ll admit to meddling with forces I do not understand):



From 2b612ffb6b0378a9e1fb0fe0bde8eab07905431d Mon Sep 17 00:00:00 2001
From: Gregory Lumen &lt;gregorylumen@microsoft.com&gt;
Date: Wed, 6 Apr 2022 16:33:09 +0000
Subject: [PATCH] Runqueue: Attempting mc support for write_diffscenetasks

---
 bitbake/lib/bb/runqueue.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index a4bcab64d0..c06f32e5bf 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1695,7 +1695,7 @@ class RunQueue:
             (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
             pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
             h = self.rqdata.runtaskentries[tid].hash
-            matches = bb.siggen.find_siginfo(pn, taskname, [], self.cfgData)
+            matches = bb.siggen.find_siginfo(pn, taskname, [], self.cooker.databuilder.mcdata[mc])
             match = None
             for m in matches:
                 if h in m:
-- 
2.25.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92953</commentid>
    <comment_count>2</comment_count>
    <who name="Gregory Lumen">gregorylumen</who>
    <bug_when>2022-04-07 16:53:00 +0000</bug_when>
    <thetext>I also found the following patch necessary before dump-signatures could successfully locate some of the SSTATE siginfo files needed for comparison:

From 2d89705c97fedc54b59a9ddedeabe19341901a14 Mon Sep 17 00:00:00 2001
From: Gregory Lumen &lt;gregorylumen@microsoft.com&gt;
Date: Wed, 6 Apr 2022 21:16:59 +0000
Subject: [PATCH] Fixing find_siginfo

---
 bitbake/lib/bb/runqueue.py | 2 ++
 meta/lib/oe/sstatesig.py   | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 9d6d44ae35..ff959abbb2 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1708,6 +1708,8 @@ class RunQueue:
                 prevh = __find_sha256__.search(latestmatch).group(0)
                 output = bb.siggen.compare_sigfiles(latestmatch, match, recursecb)
                 bb.plain(&quot;\nTask %s:%s couldn&apos;t be used from the cache because:\n  We need hash %s, closest matching task was %s\n  &quot; % (pn, taskname, h, prevh) + &apos;\n  &apos;.join(output))
+            else:
+                bb.plain(&quot;\nTask %s:%s not found in the cache&quot; % (pn, taskname))
 
 
 class RunQueueExecute:
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index c2e3e2f4f5..9768b00fc4 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -382,15 +382,16 @@ def find_siginfo(pn, taskname, taskhashlist, d):
             localdata.setVar(&apos;PV&apos;, &apos;*&apos;)
             localdata.setVar(&apos;PR&apos;, &apos;*&apos;)
             localdata.setVar(&apos;BB_TASKHASH&apos;, hashval)
+            localdata.setVar(&apos;SSTATE_CURRTASK&apos;, taskname[3:])
             swspec = localdata.getVar(&apos;SSTATE_SWSPEC&apos;)
             if taskname in [&apos;do_fetch&apos;, &apos;do_unpack&apos;, &apos;do_patch&apos;, &apos;do_populate_lic&apos;, &apos;do_preconfigure&apos;] and swspec:
                 localdata.setVar(&apos;SSTATE_PKGSPEC&apos;, &apos;${SSTATE_SWSPEC}&apos;)
             elif pn.endswith(&apos;-native&apos;) or &quot;-cross-&quot; in pn or &quot;-crosssdk-&quot; in pn:
                 localdata.setVar(&apos;SSTATE_EXTRAPATH&apos;, &quot;${NATIVELSBSTRING}/&quot;)
-            sstatename = taskname[3:]
-            filespec = &apos;%s_%s.*.siginfo&apos; % (localdata.getVar(&apos;SSTATE_PKG&apos;), sstatename)
+            filespec = &apos;%s.siginfo&apos; % localdata.getVar(&apos;SSTATE_PKG&apos;)
 
             matchedfiles = glob.glob(filespec)
+
             for fullpath in matchedfiles:
                 actual_hashval = get_hashval(fullpath)
                 if actual_hashval in hashfiles:
-- 
2.25.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93190</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-04-28 14:14:39 +0000</bug_when>
    <thetext>Thanks for these, they look like the correct fixes to me. Since I&apos;d spent the time to check them, I&apos;ve written up commit messages and sent the patches out for wider review/testing. Please feel free to submit patches like this on the mailing list in future!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93244</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-05-09 11:23:54 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/poky/commit/?id=a0b8419a7ccd5715c6bdf37d044e910e81a6a315
https://git.yoctoproject.org/poky/commit/?id=e141d586f2c4e4021c69b6bb2c28ed4e2bb05bb3</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>