<?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>1398</bug_id>
          
          <creation_ts>2011-08-24 10:29:35 +0000</creation_ts>
          <short_desc>Provide a helpful message when MACHINE is not defined</short_desc>
          <delta_ts>2011-08-31 16:30:19 +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>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>Patch our for review on mailing list</status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>1.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Darren Hart">dvhart</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>15702</commentid>
    <comment_count>0</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2011-08-24 10:29:35 +0000</bug_when>
    <thetext>It isn&apos;t uncommon for something to go wrong with the .conf files when one is doing a lot of builds. On a couple occasions I&apos;ve ended up with a config without a MACHINE defined. The message back from bitbake could be a lot more helpful / parsable:

Pseudo is not present but is required, building this first before the main build
ERROR: Execution of event handler &apos;check_sanity_eventhandler&apos; failed
Traceback (most recent call last):
  File &quot;/home/dvhart/source/poky.git/bitbake/lib/bb/data_smart.py&quot;, line 60, in VariableParse.var_sub(match=&lt;_sre.SRE_Match object at 0x1795238&gt;):
                         raise Exception(&quot;variable %s references itself!&quot; % self.varname)
    &gt;            var = self.d.getVar(key, 1)
                 if var is not None:
  File &quot;/home/dvhart/source/poky.git/bitbake/lib/bb/data_smart.py&quot;, line 271, in DataSmart.getVar(var=&apos;MACHINE_ARCH&apos;, expand=1, noweakdefault=False):
         def getVar(self, var, expand=False, noweakdefault=False):
    &gt;        return self.getVarFlag(var, &quot;content&quot;, expand, noweakdefault)

  File &quot;/home/dvhart/source/poky.git/bitbake/lib/bb/data_smart.py&quot;, line 318, in DataSmart.getVarFlag(var=&apos;MACHINE_ARCH&apos;, flag=&apos;content&apos;, expand=1, noweakdefault=False):
             if expand and value:
    &gt;            value = self.expand(value, None)
             return value
  File &quot;/home/dvhart/source/poky.git/bitbake/lib/bb/data_smart.py&quot;, line 144, in DataSmart.expand(s=&quot;${@[bb.data.getVar(&apos;TUNE_PKGARCH&apos;, d, 1), bb.data.getVar(&apos;MACHINE&apos;, d, 1)][bool(bb.data.getVar(&apos;MACHINE&apos;, d, 1))].replace(&apos;-&apos;, &apos;_&apos;)}&quot;, varname=None):
         def expand(self, s, varname):
    &gt;        return self.expandWithRefs(s, varname).value

  File &quot;/home/dvhart/source/poky.git/bitbake/lib/bb/data_smart.py&quot;, line 134, in DataSmart.expandWithRefs(s=&quot;${@[bb.data.getVar(&apos;TUNE_PKGARCH&apos;, d, 1), bb.data.getVar(&apos;MACHINE&apos;, d, 1)][bool(bb.data.getVar(&apos;MACHINE&apos;, d, 1))].replace(&apos;-&apos;, &apos;_&apos;)}&quot;, varname=None):
                 except Exception as exc:
    &gt;                raise ExpansionError(varname, s, exc)

ExpansionError: Failure expanding variable None, expression was ${@[bb.data.getVar(&apos;TUNE_PKGARCH&apos;, d, 1), bb.data.getVar(&apos;MACHINE&apos;, d, 1)][bool(bb.data.getVar(&apos;MACHINE&apos;, d, 1))].replace(&apos;-&apos;, &apos;_&apos;)} which triggered exception AttributeError: &apos;NoneType&apos; object has no attribute &apos;replace&apos;

ERROR: Failure expanding variable None, expression was ${@[bb.data.getVar(&apos;TUNE_PKGARCH&apos;, d, 1), bb.data.getVar(&apos;MACHINE&apos;, d, 1)][bool(bb.data.getVar(&apos;MACHINE&apos;, d, 1))].replace(&apos;-&apos;, &apos;_&apos;)} which triggered exception AttributeError: &apos;NoneType&apos; object has no attribute &apos;replace&apos;
ERROR: Command execution failed: Exited with 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15916</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-08-31 12:55:19 +0000</bug_when>
    <thetext>Fixed in master: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=a8d5225c3c05b6f6c48e7db5cfb81786ae52b89b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15924</commentid>
    <comment_count>2</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2011-08-31 16:30:19 +0000</bug_when>
    <thetext>Just tested locally, fix verified.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>