On the dunfell branch I've recently updated meta-sancloud so that LAYERDEPENDS and LAYERRECOMMENDS are set as follows: LAYERDEPENDS_meta-sancloud = " \ core \ meta-ti \ " LAYERRECOMMENDS_meta-sancloud = " \ rtlwifi \ " The `rtlwifi` collection is provided by https://github.com/EmbeddedAndroid/meta-rtlwifi which only contains a master branch, it has no dunfell branch. The master branch of meta-rtlwifi indicates compatibility with dunfell so our usual process is to use the dunfell branch of meta-sancloud, oe-core, meta-ti and other layers plus the master branch of meta-rtlwifi. However, the layer index only looks at the branch names and so does not list meta-rtlwifi on the dunfell branch. If meta-sancloud had a dependency on meta-rtlwifi, it would be dropped from the layerindex for the dunfell branch as dependencies could not be satisfied. This was previously seen before I modified the LAYERDEPENDS and LAYERRECOMMENDS values above in our layer. However, with meta-rtlwifi listed as a recommendation the meta-sancloud layer is accepted and included in the layerindex for the dunfell branch. This results in invalid dependency information being generated. I'll attach the full json files in follow up comments as I can only add one attachment at a time but here I will just include the relevant lines. In the layerBranches list for dunfell meta-sancloud is present: {"id":1631501,"collection":"meta-sancloud","version":null,"vcs_subdir":"","vcs_last_fetch":"2020-06-23T11:06:23+0000","vcs_last_rev":"e3117953a0213c896cc9c8559dc91fffdff41baf","vcs_last_commit":"2020-06-23T08:06:22+0000","actual_branch":"","local_path":"","updated":"2020-06-23T11:06:23+0000","layer":469,"branch":18,"yp_compatible_version":null} In the layerDependencies list for dunfell there are 3 entries which match the ID of the meta-sancloud layer: {"id":700743,"required":true,"layerbranch":1631501,"dependency":1} {"id":700744,"required":true,"layerbranch":1631501,"dependency":26} {"id":700745,"required":false,"layerbranch":1631501,"dependency":325} These correspond to the layers oe-core, meta-ti and meta-rtlwifi. The first two are present in the layerBranches list for dunfell however meta-rtlwifi (layer 325) is not. meta-rtlwifi is present in the layerBranches list for master but the client does not look there. This data appears to be invalid as the "dependency" value for the layerDependencies entry with ID 700745 does not refer to a layer that is present in the corresponing layerBranches list. Bitbake fails to parse this data and prints out a backtrace: pokyuser@86145e976448:/w/poky/build$ bitbake-layers layerindex-fetch meta-sancloud -b dunfell NOTE: Starting bitbake server... Loading https://layers.openembedded.org/layerindex/api/;branch=dunfell... Traceback (most recent call last): File "/w/poky/bitbake/bin/bitbake-layers", line 95, in <module> ret = main() File "/w/poky/bitbake/bin/bitbake-layers", line 88, in main return args.func(args) File "/w/poky/bitbake/lib/bblayers/layerindex.py", line 119, in do_layerindex_fetch (dependencies, invalidnames) = lIndex.find_dependencies(names=args.layername, ignores=ignore_layers) File "/w/poky/bitbake/lib/layerindexlib/__init__.py", line 443, in find_dependencies (dependencies, invalid) = _resolve_dependencies(layerbranches, ignores, dependencies, invalid) File "/w/poky/bitbake/lib/layerindexlib/__init__.py", line 386, in _resolve_dependencies deplayerbranch = layerdependency.dependency_layerBranch File "/w/poky/bitbake/lib/layerindexlib/__init__.py", line 915, in __getattr__ raise AttributeError('%s not in datastore' % name) AttributeError: dependency_layerBranch not in datastore I think the backtrace is also an issue - bitbake-layers should reject invalid data from the layerindex with a meaningful error message instead of a backtrace. I've opened a bug against meta-rtlwifi to request that a dunfell branch is created: https://github.com/EmbeddedAndroid/meta-rtlwifi/issues/16 I'm also looking to work around this by temporarily dropping the LAYERRECOMMENDS setting from meta-sancloud and leaving users to add the meta-rtlwifi layer separately if they need wifi support. However that's not ideal. For us the ideal fix would be to extend the layerindex to handle repositories which contain only the master branch but actually declare support for multiple Yocto Project release series. That would require parsing LAYERSERIES_COMPAT for the master branch of each layer, possibly with the addition of some way of indicating which branches to check when a layer is added to the index. That may not be the quickest thing to fix though, maybe it would be better to add data validation and handle layer recommendations (allowing them to fail with a warning) separately from layer dependencies.
Created attachment 4693 [details] layerBranches.json for dunfell branch
Created attachment 4694 [details] layerDependencies.json for dunfell branch
Created attachment 4695 [details] layerBranches.json for master branch
This is already supported in the index, except for the piece of parsing master and declaring it in one of the branches. The way that you do this (from an admin point of view) is to create a new branch for an existing layer, then set the branch name (manually) to master [or any other branch name] that is compatible. Then on the next indexing it will ignore the 'default' branch name, and use the custom one. So in this case, you just need to request one of the admins add a layer index branch for your layer pointing to master.
The layer that would need the dunfell branch manually defining is meta-rtlwifi, I'm not the maintainer of that layer though so not sure if I should request that myself.
The meta-rtlwifi layer has now added a dunfell branch. The layerindex has been updated and now everything works as expected for the meta-sancloud layer on the dunfell branch. However, this bug is still worth a look. The invalid json data is captured in the attachments so it can still be investigated.
This bug also affects meta-browser which does not have a dunfell branch - dunfell is supported on the master branch.
If I might chime-in: I ran a set of tests using the dunfell branch. The call of 'bitbake-layers layerindex-fetch' failed here for: meta-acrn meta-arago-distro meta-chromebook meta-intel meta-libretro openembedded-core
Any update?
Hey Tim, were you going to work on layerindex?
Bulk move of 64 bugs to 4.3 M3 after a quick review. If a bug is actually fixed, please add a commit link and resolve it. -- Randy for YP bug team.
Moved to M4.
Bulk move to 5.0 M1. -- Randy
If you try to run "bitbake-layers layerindex-fetch meta-sancloud -b dunfell" using current "master" you instead get: ERROR: Variable BB_HASHBASE_WHITELIST_append file: /path/to/poky/meta-arm/meta-arm-toolchain/conf/layer.conf line: 18 contains an operation using the old override syntax. Please convert this layer/metadata before attempting to use with a newer bitbake. ERROR: Unable to parse /path/to/poky/bitbake/lib/bb/__init__.py Traceback (most recent call last): File "/path/to/poky/bitbake/lib/bb/__init__.py", line 182, in fatal: mainlogger.critical(''.join(args), extra=kwargs) > raise BBHandledException() bb.BBHandledException ERROR: Parse failure with the specified layer added, exiting.
If you run with a "dunfell" poky, everything is fine. I'm guessing that we need some checks/conditionals in the "layerindex-fetch" code of bitbake-layers?
Bulk move of 52 5.0-M1 bugs to M2.
https://lore.kernel.org/bitbake-devel/e810a80d2aa60cbfbca64abd52101a8c856c80c5.1618588951.git.diego.sueiro@arm.com/ is needed to avoid args.shallow being undefined. $ bitbake-layers layerindex-show-depends meta-dpdk NOTE: Starting bitbake server... Loading https://layers.openembedded.org/layerindex/api/;branch=dunfell... Layer Git repository (branch) Subdirectory ============================================================================================================================= local:HEAD:openembedded-core https://git.yoctoproject.org/poky.git (dunfell) meta required by: meta-dpdk layers.openembedded.org:dunfell:meta-dpdk git://git.yoctoproject.org/meta-dpdk (dunfell) Traceback (most recent call last): File "/srv/build/ttorling/workspace-dunfell/poky/bitbake/bin/bitbake-layers", line 95, in <module> ret = main() File "/srv/build/ttorling/workspace-dunfell/poky/bitbake/bin/bitbake-layers", line 88, in main return args.func(args) File "/srv/build/ttorling/workspace-dunfell/poky/bitbake/lib/bblayers/layerindex.py", line 209, in do_layerindex_show_depends self.do_layerindex_fetch(args) File "/srv/build/ttorling/workspace-dunfell/poky/bitbake/lib/bblayers/layerindex.py", line 182, in do_layerindex_fetch args.shallow) AttributeError: 'Namespace' object has no attribute 'shallow'
Filed https://bugzilla.yoctoproject.org/show_bug.cgi?id=15365 as the backtrace is not in layerindex-web code, but rather in bitbake/lib/layerindex code.
Closing this bug, as the bitbake-layers bug is where the fix needs to be tracked. That work did not make the 5.0M3 feature freeze and will have to move to 5.1. It is also related to actual metadata being present in the layerindex, which should be filed in the Layer Index Metadata component. So moving to that component as well.