<?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>2981</bug_id>
          
          <creation_ts>2012-08-21 14:42:40 +0000</creation_ts>
          <short_desc>tracebacks should be better when exception raised in anonymous python</short_desc>
          <delta_ts>2012-08-23 13:01:39 +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>Patches out for review</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>24285</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2012-08-21 14:42:40 +0000</bug_when>
    <thetext>I&apos;m chasing a bug in a piece of anonymous python in base.bbclass.

$ MACHINE=qemuppc bitbake -b ../meta/recipes-graphics/mesa/mesa-xlib_8.0.4.bb 
ERROR: Error executing a python function in &lt;code&gt;:
AttributeError: &apos;list&apos; object has no attribute &apos;split&apos;

ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR:   File &quot;&lt;code&gt;&quot;, line 2, in &lt;module&gt;
ERROR: 
ERROR:   File &quot;__anon_567__home_ross_Yocto_poky_meta_classes_base_bbclass&quot;, line 51, in __anon_567__home_ross_Yocto_poky_meta_classes_base_bbclass
ERROR: 
ERROR: The code that was being executed was:
ERROR:      0001:__anon_124__home_ross_Yocto_poky_meta_classes_staging_bbclass(d)
ERROR:  *** 0002:__anon_567__home_ross_Yocto_poky_meta_classes_base_bbclass(d)
ERROR:      0003:__anon_177__home_ross_Yocto_poky_meta_classes_package_bbclass(d)
ERROR:      0004:__anon_452__home_ross_Yocto_poky_meta_classes_package_ipk_bbclass(d)
ERROR:      0005:__anon_753__home_ross_Yocto_poky_meta_classes_insane_bbclass(d)
ERROR:      0006:__anon_20__home_ross_Yocto_poky_meta_classes_debian_bbclass(d)
ERROR: (file: &apos;&lt;code&gt;&apos;, lineno: 2, function: &lt;module&gt;)
ERROR: Command execution failed: Traceback (most recent call last):
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/command.py&quot;, line 87, in runAsyncCommand
    commandmethod(self.cmds_async, self, options)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/command.py&quot;, line 203, in buildFile
    command.cooker.buildFile(bfile, task)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/cooker.py&quot;, line 1053, in buildFile
    self.caches_array)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/cache.py&quot;, line 401, in parse
    datastores = cls.load_bbfile(filename, appends, configdata)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/cache.py&quot;, line 660, in load_bbfile
    bb_data = parse.handle(bbfile, bb_data)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/parse/__init__.py&quot;, line 91, in handle
    return h[&apos;handle&apos;](fn, data, include)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py&quot;, line 157, in handle
    return ast.multi_finalize(fn, d)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/parse/ast.py&quot;, line 381, in multi_finalize
    finalize(fn, d)
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/parse/ast.py&quot;, line 323, in finalize
    bb.utils.better_exec(&quot;\n&quot;.join(code), {&quot;d&quot;: d}, &quot;\n&quot;.join(code))
  File &quot;/home/ross/Yocto/poky/bitbake/lib/bb/utils.py&quot;, line 231, in better_exec
    exec(code, _context, context)
  File &quot;&lt;code&gt;&quot;, line 2, in &lt;module&gt;
  File &quot;__anon_567__home_ross_Yocto_poky_meta_classes_base_bbclass&quot;, line 51, in __anon_567__home_ross_Yocto_poky_meta_classes_base_bbclass
AttributeError: &apos;list&apos; object has no attribute &apos;split&apos;

(I&apos;ve replaced the simple_exec with better_exec)

It would be really useful if the trace included the source code of __anon_567__home_ross_Yocto_poky_meta_classes_base_bbclass().  We&apos;ve obviously got it, so where is it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24287</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2012-08-21 15:07:22 +0000</bug_when>
    <thetext>Easy way to reproduce is to use poky 91ece5d5668ee1adb5c5e3d757426a0d5187bd84.

The exact circumstances of this bug appear to be to have a PACKAGECONFIG_append_{arch} override that doesn&apos;t apply for the current architecture, i.e. mesa-common has a _x86 override and we&apos;re building on ppc.  This results in the _append flag being in the PACKAGECONFIG var flags that are being enumerated, and this crashes later when the code assumes it has a string.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24354</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-08-22 19:08:04 +0000</bug_when>
    <thetext>Patches out for review which at least massively improve this. They&apos;re not perfect but this failure case now looks like:

ERROR: Error executing a python function in &lt;code&gt;:
AttributeError: &apos;list&apos; object has no attribute &apos;split&apos;

ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR:   File &quot;&lt;code&gt;&quot;, line 2, in &lt;module&gt;
ERROR: 
ERROR:   File &quot;__anon_564__media_build1_poky_meta_classes_base_bbclass&quot;, line 48, in __anon_564__media_build1_poky_meta_classes_base_bbclass
ERROR: 
ERROR: The code that was being executed was:
ERROR:      0001:__anon_124__media_build1_poky_meta_classes_staging_bbclass(d)
ERROR:  *** 0002:__anon_564__media_build1_poky_meta_classes_base_bbclass(d)
ERROR:      0003:__anon_177__media_build1_poky_meta_classes_package_bbclass(d)
ERROR:      0004:__anon_452__media_build1_poky_meta_classes_package_ipk_bbclass(d)
ERROR:      0005:__anon_756__media_build1_poky_meta_classes_insane_bbclass(d)
ERROR:      0006:__anon_20__media_build1_poky_meta_classes_debian_bbclass(d)
ERROR: [From file: &apos;&lt;code&gt;&apos;, lineno: 2, function: &lt;module&gt;]
ERROR:      0044:        extraconf = []
ERROR:      0045:        for flag, flagval in pkgconfigflags.items():
ERROR:      0046:            if flag == &quot;defaultval&quot;:
ERROR:      0047:                continue
ERROR:  *** 0048:            items = flagval.split(&quot;,&quot;)
ERROR:      0049:            num = len(items)
ERROR:      0050:            if num &gt; 4:
ERROR:      0051:                bb.error(&quot;Only enable,disable,depend,rdepend can be specified!&quot;)
ERROR:      0052:
ERROR: [From file: &apos;__anon_564__media_build1_poky_meta_classes_base_bbclass&apos;, lineno: 48, function: __anon_564__media_build1_poky_meta_classes_base_bbclass]

The pointless stack trace at the end is now surpressed as an additional bonus.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24394</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-08-23 13:01:39 +0000</bug_when>
    <thetext>Merged in master http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=64c002875fe0a153760f174b868dc702227c00af (along with help from suddounding commits)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>