Bug 11210

Summary: tinfoil: parse_recipe() fails for multiconfig pns
Product: [Build System, Metadata & Runtime] BitBake Reporter: Patrick Ohly <patrick.ohly>
Component: bitbakeAssignee: Juro Bystricky <juro.bystricky>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: poky.bs.watcher, poky.watcher, ross.burton
Version: unspecified   
Target Milestone: 2.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Patrick Ohly 2017-03-22 12:30:08 UTC
Traceback (most recent call last):
  File "/fast/work/meta-security-tools/scripts/sdl-whitelist-status.py", line 97, in <module>
    tinfoil.parse_recipe('multiconfig:qemuarm:gcc')
  File "/fast/work/bitbake/lib/bb/tinfoil.py", line 350, in parse_recipe
    return self.parse_recipe_file(fn)
  File "/fast/work/bitbake/lib/bb/tinfoil.py", line 373, in parse_recipe_file
    dscon = self.run_command('parseRecipeFile', fn, appends, appendlist)
  File "/fast/work/bitbake/lib/bb/tinfoil.py", line 281, in run_command
    raise TinfoilCommandFailed(result[1])
bb.tinfoil.TinfoilCommandFailed: Traceback (most recent call last):
  File "/fast/work/bitbake/lib/bb/command.py", line 81, in runCommand
    result = command_method(self, commandline)
  File "/fast/work/bitbake/lib/bb/command.py", line 521, in parseRecipeFile
    appendfiles = command.cooker.collection.get_file_appends(fn)
  File "/fast/work/bitbake/lib/bb/cooker.py", line 1961, in get_file_appends
    f = os.path.basename(fn)
  File "/usr/lib/python3.4/posixpath.py", line 139, in basename
    i = p.rfind(sep) + 1
AttributeError: 'NoneType' object has no attribute 'rfind'

'multiconfig:qemuarm:gcc' is a valid pn because of:
$ cat conf/multiconfig/qemuarm.conf 
MACHINE = "qemuarm"
$ grep -e ^BBMULTICONFIG -e ^MACHINE conf/local.conf
MACHINE ?= "intel-corei7-64"
BBMULTICONFIG = "qemuarm"

Looks like fn = self.get_recipe_file(pn) fails to find the file name.

Note that there's also no error handling when passing some entirely invalid pn. tinfoil.parse_recipe('foobar') fails the same way.
Comment 2 Juro Bystricky 2017-04-06 14:45:04 UTC
patch not accepted, back to the drawing board...
Comment 3 Juro Bystricky 2017-04-10 18:11:07 UTC
sent patches updated according to feedback:
http://lists.openembedded.org/pipermail/bitbake-devel/2017-April/008618.html
Comment 4 Ross Burton 2017-04-19 15:49:35 UTC
Merged in Bitbake e9c03fbfd7b057b28645affa263cb4aebfa24b04.