<?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>5738</bug_id>
          
          <creation_ts>2014-01-17 13:08:54 +0000</creation_ts>
          <short_desc>Default &apos;noop&apos; signature handler isn&apos;t compatible with latest codebase</short_desc>
          <delta_ts>2015-05-18 10:34:42 +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>1.7</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>Low</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Jansa">Martin.Jansa</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>rudolf.streif</cc>
    
    <cc>sgw</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>39894</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2014-01-17 13:08:54 +0000</bug_when>
    <thetext>When working on https://github.com/openwebos/meta-webos/commit/9ac3a7c803e7793b3274e4998f167b6278db8042 I&apos;ve noticed that this area is a bit error prone and the reporting isn&apos;t very helpful in bitbake 1.18.

With bitbake 1.21.1 (and IIRC 1.20 as well) it&apos;s better and missing OE_IMPORTS addition or typo in BB_SIGNATURE_HANDLER results in good error message:

OE qemux86-64@ ~/build/oe-core $ bitbake -S dbus
ERROR: Invalid signature generator &apos;OEBasicHashFoo&apos;, using default &apos;noop&apos;
Available generators: basichash, noop, OEBasic, basic, OEBasicHash
...
but then it throws exception from noop hander, because dump_sigs is implemented only in SignatureGeneratorBasic not in SignatureGenerator (&apos;noop&apos;).

NOTE: Reparsing files to collect dependency data
ERROR: An uncaught exception occured in runqueue, please see the failure below:
ERROR: Running idle function
Traceback (most recent call last):
  File &quot;/OE/build/oe-core/bitbake/lib/bb/server/process.py&quot;, line 133, in ProcessServer.idle_commands(delay=0.1, fds=[&lt;read-only Connection, handle 3&gt;, &lt;read-write Connection, handle 6&gt;]):
                 try:
    &gt;                retval = function(self, data, False)
                     if retval is False:
  File &quot;/OE/build/oe-core/bitbake/lib/bb/cooker.py&quot;, line 1177, in buildTargetsIdle(server=&lt;ProcessServer(ProcessServer-2, started)&gt;, rq=&lt;bb.runqueue.RunQueue instance at 0x83bff38&gt;, abort=False):
                 try:
    &gt;                retval = rq.execute_runqueue()
                 except runqueue.TaskFailure as exc:
  File &quot;/OE/build/oe-core/bitbake/lib/bb/runqueue.py&quot;, line 1082, in RunQueue.execute_runqueue():
             try:
    &gt;            return self._execute_runqueue()
             except bb.runqueue.TaskFailure:
  File &quot;/OE/build/oe-core/bitbake/lib/bb/runqueue.py&quot;, line 1033, in RunQueue._execute_runqueue():
                     invalidtasks = self.print_diffscenetasks()
    &gt;                self.dump_signatures()
                     self.write_diffscenetasks(invalidtasks)
  File &quot;/OE/build/oe-core/bitbake/lib/bb/runqueue.py&quot;, line 1114, in RunQueue.dump_signatures():

    &gt;        bb.parse.siggen.dump_sigs(self.rqdata.dataCache)

AttributeError: &apos;SignatureGenerator&apos; object has no attribute &apos;dump_sigs&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39895</commentid>
    <comment_count>1</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2014-01-17 13:12:50 +0000</bug_when>
    <thetext>Adding empty dump_sigs helps, but it will still show error a bit later (with new -S functionality in master)

NOTE: Reparsing files to collect dependency data
ERROR: Can&apos;t find a task we&apos;re supposed to have written out? (hash: 0)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39896</commentid>
    <comment_count>2</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2014-01-17 13:13:59 +0000</bug_when>
    <thetext>http://lists.openembedded.org/pipermail/bitbake-devel/2014-January/004336.html is the first part with empty dump_sigs()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39940</commentid>
    <comment_count>3</comment_count>
    <who name="Rudolf J Streif">rudolf.streif</who>
    <bug_when>2014-01-20 20:53:37 +0000</bug_when>
    <thetext>I noticed that too when trying my BitBake HelloWorld against the latest from master. The reason is that bitbake/lib/bb/runqueue.py when setting

workerdata = {
...
            &quot;hashes&quot; : bb.parse.siggen.taskhash,
            &quot;hash_deps&quot; : bb.parse.siggen.runtaskdeps,
            &quot;sigchecksums&quot; : bb.parse.siggen.file_checksum_values,
...
}

I do not think it makes sense at all to run BitBake without a signature handler. The simplest approach to fixing this would be setting the default signature handler to &apos;basic&apos; instead of &apos;noop&apos;.



Signed-off-by: Rudolf J Streif &lt;rudolf.streif@linux.com&gt;
---
 lib/bb/siggen.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 9db29a2..159ab72 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -17,13 +17,13 @@ def init(d):
     siggens = [obj for obj in globals().itervalues()
                       if type(obj) is type and issubclass(obj, SignatureGenerator)]

-    desired = d.getVar(&quot;BB_SIGNATURE_HANDLER&quot;, True) or &quot;noop&quot;
+    desired = d.getVar(&quot;BB_SIGNATURE_HANDLER&quot;, True) or &quot;basic&quot;
     for sg in siggens:
         if desired == sg.name:
             return sg(d)
             break
     else:
-        logger.error(&quot;Invalid signature generator &apos;%s&apos;, using default &apos;noop&apos;\n&quot;
+        logger.error(&quot;Invalid signature generator &apos;%s&apos;, using default &apos;basic&apos;\n&quot;
                      &quot;Available generators: %s&quot;, desired,
                      &apos;, &apos;.join(obj.name for obj in siggens))
         return SignatureGenerator(d)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39941</commentid>
    <comment_count>4</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2014-01-20 22:08:53 +0000</bug_when>
    <thetext>RP already merged my patch partially fixing this, but I&apos;m fine with changing the default to &quot;basic&quot; too (then we should probably remove &quot;noop&quot; completely to reduce confusion).

I wasn&apos;t trying to use noop intentionally, I was only bitten by it by those accidents with my own handler.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39942</commentid>
    <comment_count>5</comment_count>
    <who name="Rudolf J Streif">rudolf.streif</who>
    <bug_when>2014-01-20 22:59:57 +0000</bug_when>
    <thetext>Alternatively the patch below fixes the SignatureGenerator to not break anything. That would leave the SignatureGenerator base class intact to derive others from. Removing &apos;noop&apos; may break alternative implementations of signature generators that are derived from it, if there are any.

If there are any they then apparently define the three attributes taskhash, runtaskdeps and file_checksum_values and also override get_taskhash.


Signed-off-by: Rudolf J Streif &lt;rudolf.streif@linux.com&gt;
---
 lib/bb/siggen.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 9db29a2..a7f1396 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -34,7 +34,10 @@ class SignatureGenerator(object):
     name = &quot;noop&quot;

     def __init__(self, data):
-        return
+        self.taskhash = {}
+        self.runtaskdeps = {}
+        self.file_checksum_values = {}
+

     def finalise(self, fn, d, varient):
         return
@@ -42,7 +45,7 @@ class SignatureGenerator(object):
     def get_taskhash(self, fn, task, deps, dataCache):
         return &quot;0&quot;

-    def set_taskdata(self, hashes, deps):
+    def set_taskdata(self, hashes, deps, checksums):
         return

     def stampfile(self, stampbase, file_name, taskname, extrainfo):</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51062</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-05-18 10:34:42 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/bitbake/lib/bb/siggen.py?id=5e5a7fc37c65688c7e7a57e73268fab93a367143
http://git.yoctoproject.org/cgit.cgi/poky/commit/bitbake/lib/bb/siggen.py?id=d955d6a8f52edcffe3c81af7b01f2e3843dbe432</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>