diff options
author | Tim Orling <tim.orling@konsulko.com> | 2024-02-23 12:58:35 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-27 11:36:38 +0000 |
commit | 28414495277e87898c9ac5314b88ebb747494dac (patch) | |
tree | acd2e423126ce91be886316e0827ed3a4c798a27 /bitbake/lib/layerindexlib/__init__.py | |
parent | 54c27d84b6369daef372741b8184304d3e5d3925 (diff) | |
download | poky-28414495277e87898c9ac5314b88ebb747494dac.tar.gz |
bitbake: layerindexlib: fix missing layer branch backtrace
When a LayerBranch (a specific layer at a specific release) does not
exist in the layerindex database ("Layerindex Metadata"), the dependency
would throw a backtrace. Instead fail early and provide an error message.
Since layerindexlib will also check the local layers, inform the user that
a local checkout might resolve the situation. Recommend that they reach
out to the layer maintainers and layer index admins to properly fix it for
everyone.
While we are here, remove some trailing whitespace.
[YOCTO #15365]
[YOCTO #13954]
(Bitbake rev: 96cbe8f87209a927c157ebcf469f8b9d54fcf92e)
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/layerindexlib/__init__.py')
-rw-r--r-- | bitbake/lib/layerindexlib/__init__.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/bitbake/lib/layerindexlib/__init__.py b/bitbake/lib/layerindexlib/__init__.py index ac03d89876..c3265ddaa1 100644 --- a/bitbake/lib/layerindexlib/__init__.py +++ b/bitbake/lib/layerindexlib/__init__.py | |||
@@ -178,9 +178,9 @@ class LayerIndex(): | |||
178 | '''Load the layerindex. | 178 | '''Load the layerindex. |
179 | 179 | ||
180 | indexURI - An index to load. (Use multiple calls to load multiple indexes) | 180 | indexURI - An index to load. (Use multiple calls to load multiple indexes) |
181 | 181 | ||
182 | reload - If reload is True, then any previously loaded indexes will be forgotten. | 182 | reload - If reload is True, then any previously loaded indexes will be forgotten. |
183 | 183 | ||
184 | load - List of elements to load. Default loads all items. | 184 | load - List of elements to load. Default loads all items. |
185 | Note: plugs may ignore this. | 185 | Note: plugs may ignore this. |
186 | 186 | ||
@@ -383,7 +383,14 @@ layerBranches set. If not, they are effectively blank.''' | |||
383 | 383 | ||
384 | # Get a list of dependencies and then recursively process them | 384 | # Get a list of dependencies and then recursively process them |
385 | for layerdependency in layerbranch.index.layerDependencies_layerBranchId[layerbranch.id]: | 385 | for layerdependency in layerbranch.index.layerDependencies_layerBranchId[layerbranch.id]: |
386 | deplayerbranch = layerdependency.dependency_layerBranch | 386 | try: |
387 | deplayerbranch = layerdependency.dependency_layerBranch | ||
388 | except AttributeError as e: | ||
389 | logger.error('LayerBranch does not exist for dependent layer {}:{}\n' \ | ||
390 | ' Cannot continue successfully.\n' \ | ||
391 | ' You might be able to resolve this by checking out the layer locally.\n' \ | ||
392 | ' Consider reaching out the to the layer maintainers or the layerindex admins' \ | ||
393 | .format(layerdependency.dependency.name, layerbranch.branch.name)) | ||
387 | 394 | ||
388 | if ignores and deplayerbranch.layer.name in ignores: | 395 | if ignores and deplayerbranch.layer.name in ignores: |
389 | continue | 396 | continue |
@@ -846,7 +853,7 @@ class LayerIndexObj(): | |||
846 | continue | 853 | continue |
847 | 854 | ||
848 | for layerdependency in layerbranch.index.layerDependencies_layerBranchId[layerbranch.id]: | 855 | for layerdependency in layerbranch.index.layerDependencies_layerBranchId[layerbranch.id]: |
849 | deplayerbranch = layerdependency.dependency_layerBranch | 856 | deplayerbranch = layerdependency.dependency_layerBranch or None |
850 | 857 | ||
851 | if ignores and deplayerbranch.layer.name in ignores: | 858 | if ignores and deplayerbranch.layer.name in ignores: |
852 | continue | 859 | continue |