Bug 1398 - Provide a helpful message when MACHINE is not defined
Summary: Provide a helpful message when MACHINE is not defined
Status: VERIFIED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Low minor
Target Milestone: 1.2
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard: Patch our for review on mailing list
Depends on:
Blocks:
 
Reported: 2011-08-24 10:29 UTC by Darren Hart
Modified: 2011-08-31 16:30 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darren Hart 2011-08-24 10:29:35 UTC
It isn't uncommon for something to go wrong with the .conf files when one is doing a lot of builds. On a couple occasions I'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 'check_sanity_eventhandler' failed
Traceback (most recent call last):
  File "/home/dvhart/source/poky.git/bitbake/lib/bb/data_smart.py", line 60, in VariableParse.var_sub(match=<_sre.SRE_Match object at 0x1795238>):
                         raise Exception("variable %s references itself!" % self.varname)
    >            var = self.d.getVar(key, 1)
                 if var is not None:
  File "/home/dvhart/source/poky.git/bitbake/lib/bb/data_smart.py", line 271, in DataSmart.getVar(var='MACHINE_ARCH', expand=1, noweakdefault=False):
         def getVar(self, var, expand=False, noweakdefault=False):
    >        return self.getVarFlag(var, "content", expand, noweakdefault)

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

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

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

ERROR: Failure expanding variable None, expression was ${@[bb.data.getVar('TUNE_PKGARCH', d, 1), bb.data.getVar('MACHINE', d, 1)][bool(bb.data.getVar('MACHINE', d, 1))].replace('-', '_')} which triggered exception AttributeError: 'NoneType' object has no attribute 'replace'
ERROR: Command execution failed: Exited with 1
Comment 2 Darren Hart 2011-08-31 16:30:19 UTC
Just tested locally, fix verified.