<?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>1782</bug_id>
          
          <creation_ts>2011-11-22 11:37:16 +0000</creation_ts>
          <short_desc>Enhance bitbake&apos;s parse error handling to indicate where the failure occured</short_desc>
          <delta_ts>2012-03-12 10:16:12 +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>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>Patch merged (12 Mar)</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Darren Hart">dvhart</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</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>17337</commentid>
    <comment_count>0</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2011-11-22 11:37:16 +0000</bug_when>
    <thetext>I recently was refactoring a recipe and moved some logic from one function to another (along with several other changes). Bitbake would fail with a message like:

NOTE: Error expanding variable do_bootimg
ERROR: Unable to parse /home/dvhart/source/poky/meta/recipes-rt/images/core-image-rt.bb

I didn&apos;t modify core-image-rt.bb, nor anything it inherited|required|included directly. A few layers down it pulled in bootimg.bbclass, which I had modified. I spent a good deal of time trying to manipulate the do_bootimg assignments I made to no avail. In the end the problem was that I moved a shell fragment into a python function.

So while this was clearly developer error, I suspect it isn&apos;t all that uncommon given that we have a healthy mix of shell of python in many recipes. If bitbake could at least point to the file and function where it encountered a problem this would be a huge benefit to debugging.

I imagine this is non-trivial as there is plenty of post processing of variables and other such things that go one. Perhaps the debug flags could force a python syntax validation pass on the individual functions which could catch this sort of thing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18377</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-01-26 12:38:24 +0000</bug_when>
    <thetext>Darren, I don&apos;t suppose you have the actual change that triggered this do you?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18388</commentid>
    <comment_count>2</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-01-26 14:02:53 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Darren, I don&apos;t suppose you have the actual change that triggered this do you?

Sorry, I don&apos;t. I should have included that. I believe adding any shell-syntax statement into a python function should readily duplicate the result though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18763</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-02-26 12:15:42 +0000</bug_when>
    <thetext>I think http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=ebc0d4252a19e6ab38052473e54138d29b172dfc will have addressed this problem, it does in other variable expansion error cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18809</commentid>
    <comment_count>4</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-02-29 19:28:21 +0000</bug_when>
    <thetext>Another case where this happens is here:

$ bitbake linux-yocto -e 
ERROR: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure for URL: &apos;git:///home/dvhart/source/linux/linux-yocto-3.2.git;protocol=file;nocheckout=1;branch=yocto/standard/fri2,meta;name=machine,meta&apos;. The command git ls-remote file:///home/dvhart/source/linux/linux-yocto-3.2.git yocto/standard/fri2 gave empty output unexpectedly
ERROR: Command execution failed: Exited with 1
NOTE: Error expanding variable do_patch

Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

I&apos;m trying to setup the fri2 to use linux-yocto-3.2 and am using meta-kernel-dev, which replaces the SRC URI in a non-version specific way. I believe the above is failing because it is still trying to use linux-yocto-3.0, but I can&apos;t search for PREFERRED_PROVIDER because it fails before getting there. Printing out which recipe it&apos;s working on when it fails would help a lot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18848</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-03-02 15:42:14 +0000</bug_when>
    <thetext>Reopening as this clearly needs more attention.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18882</commentid>
    <comment_count>6</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-03-06 23:57:27 +0000</bug_when>
    <thetext>I&apos;ve sent a trivial fix to bitbake-devel for this issue:
http://lists.linuxtogo.org/pipermail/bitbake-devel/2012-March/002111.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18964</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-03-12 10:16:12 +0000</bug_when>
    <thetext>This is now fixed in master revision d599d90fd56a7ad12a376011453513d874b512de - an additional NOTE is logged upon error containing the recipe file name.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>