Bug 1141

Summary: bitbake -b prints meaningless error when given an invalid recipe name
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Scott Garman <scott.a.garman>
Component: meta-yoctoAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Low CC: bluelightning, jiajun.xu, poky.bs.watcher, poky.watcher, richard.purdie, sgw, song.liu
Version: 1.0   
Target Milestone: 1.2 M3   
Hardware: x86   
OS: Multiple   
Whiteboard: (P1)(QA Testing Completed) (Done)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Bug Depends on:    
Bug Blocks: 1543    

Description Scott Garman 2011-06-06 13:36:05 UTC
Phil Blundell reported that bitbake -b can give meaningless errors when used with invalid recipe names.

Case 1: the recipe name is invalid

bitbake -b bogus
ERROR: Command execution failed: Traceback (most recent call last):
<python traceback>
AttributeError: 'NoneType' object has no attribute 'bbfile_config_priorities'

Case 2: the recipe name is valid, but is skipped (due to COMPATIBLE_MACHINE, for example)

bitbake -b v86d
ERROR: Command execution failed: Traceback (most recent call last):
<python traceback>
AttributeError: 'NoneType' object has no attribute 'bbfile_config_priorities'

Note that if you don't include the -b option to bitbake, the above examples print out much more useful information:

ERROR: Nothing PROVIDES 'bogus'
<python traceback>
NoProvider: bogus

So I think the goal is to fix this so the NoProvider information is displayed instead (although, see bug #542 regarding ways to even improve this error case).
Comment 1 Paul Eggleton 2011-07-22 08:05:51 UTC
With latest master, bitbake -b seems to be working well again - specifying just the package name (v86d), a recipe file name with no path (v86d_0.1.9.bb), and the full path to a recipe (/home/paul/poky/poky/meta/recipes-bsp/v86d/v86d_0.1.9.bb) all work fine. What still needs to be improved ideally is what you get when you specify something that doesn't exist:

paul@helios:~/poky/poky/build$ bitbake -b bogus
ERROR: Unable to match bogus (0 matches found):
ERROR: Command execution failed: Traceback (most recent call last):
  File "/home/paul/poky/poky/bitbake/lib/bb/command.py", line 102, in runAsyncCommand
    commandmethod(self.cmds_async, self, options)
  File "/home/paul/poky/poky/bitbake/lib/bb/command.py", line 190, in buildFile
    command.cooker.buildFile(bfile, task)
  File "/home/paul/poky/poky/bitbake/lib/bb/cooker.py", line 869, in buildFile
    fn = self.matchFile(fn)
  File "/home/paul/poky/poky/bitbake/lib/bb/cooker.py", line 850, in matchFile
    raise MultipleMatches
MultipleMatches
Comment 3 Jiajun Xu 2012-02-05 07:35:53 UTC
It is verified as fixed in 1.2 M2.