Bug 13447

Summary: bitbake-layers layerindex-fetch -b fails
Product: [Build System, Metadata & Runtime] BitBake Reporter: Paul Eggleton <bluelightning>
Component: bitbakeAssignee: Mark Hatle <mark.hatle>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: mark.hatle, poky.bs.watcher, poky.watcher, randy.macleod, richard.purdie
Version: 3.0   
Target Milestone: 2.8 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Paul Eggleton 2019-07-23 03:51:32 UTC
I just went to try adding a layer to my setup using bitbake-layers layerindex-fetch and got the following:

--------------- snip ---------------
$ bitbake-layers layerindex-fetch meta-iota -b master
NOTE: Starting bitbake server...
Loading https://layers.openembedded.org/layerindex/api/;branch=master...
Traceback (most recent call last):
  File "/data/poky/bitbake/bin/bitbake-layers", line 93, in <module>
    ret = main()
  File "/data/poky/bitbake/bin/bitbake-layers", line 86, in main
    return args.func(args)
  File "/data/poky/bitbake/lib/bblayers/layerindex.py", line 113, in do_layerindex_fetch
    (dependencies, invalidnames) = lIndex.find_dependencies(names=args.layername, ignores=ignore_layers)
  File "/data/poky/bitbake/lib/layerindexlib/__init__.py", line 426, in find_dependencies
    (dependencies, invalid) = _resolve_dependencies(layerbranches, ignores, dependencies, invalid)
  File "/data/poky/bitbake/lib/layerindexlib/__init__.py", line 414, in _resolve_dependencies
    (dependencies, invalid) = _resolve_dependencies([deplayerbranch], ignores, dependencies, invalid)
  File "/data/poky/bitbake/lib/layerindexlib/__init__.py", line 414, in _resolve_dependencies
    (dependencies, invalid) = _resolve_dependencies([deplayerbranch], ignores, dependencies, invalid)
  File "/data/poky/bitbake/lib/layerindexlib/__init__.py", line 414, in _resolve_dependencies
    (dependencies, invalid) = _resolve_dependencies([deplayerbranch], ignores, dependencies, invalid)
  [Previous line repeated 985 more times]
  File "/data/poky/bitbake/lib/layerindexlib/__init__.py", line 386, in _resolve_dependencies
    deplayerbranch = layerdependency.dependency_layerBranch
  File "/data/poky/bitbake/lib/layerindexlib/__init__.py", line 1246, in dependency_layerBranch
    branchid = self.layerbranch.branch_id
  File "/data/poky/bitbake/lib/layerindexlib/__init__.py", line 1166, in layerbranch
    return self.index.layerBranches[self.layerbranch_id]
  File "/data/poky/bitbake/lib/layerindexlib/__init__.py", line 1153, in layerbranch_id
    return self.__getattr__('layerbranch')
  File "/data/poky/bitbake/lib/layerindexlib/__init__.py", line 894, in __getattr__
    if name == "index" or name.startswith('_'):
RecursionError: maximum recursion depth exceeded in comparison
--------------- snip ---------------

NOTE - I actually had the warrior branch checked out (I used -b master since the layer in question isn't shown as available in the index on warrior), so perhaps that is a factor here.
Comment 1 Richard Purdie 2019-07-25 14:35:42 UTC
Does this mean we're missing some kind of test?
Comment 2 Mark Hatle 2019-07-26 14:52:59 UTC
I'll investigate and see what I can come up with.
Comment 3 Mark Hatle 2019-07-26 15:18:27 UTC
I've found the cause.  There is a circular dependency in the master branch of the layer index:

https://layers.openembedded.org/layerindex/branch/master/layer/meta-oe/

https://layers.openembedded.org/layerindex/branch/master/layer/meta-python/


meta-pyhton requires meta-oe, meta-oe requires meta-python.  This is fundamentally broken and what is triggering the problem.

Obviously I can resolve this in the software and say it's met from a dependency standpoint -but- when constructing things which one comes first?   Or is that simply undefined?
Comment 4 Mark Hatle 2019-08-01 20:40:44 UTC
Fix sent to bitbake-devel.  We now detect and abort the dependency processing (with a warning) when we encounter circular dependencies.
Comment 5 Paul Eggleton 2019-08-04 22:27:37 UTC
Hmm, yes - meta-oe should not be depending upon meta-python. I don't know how it came to be there, but I have now removed it.