diff options
author | David Reyna <David.Reyna@windriver.com> | 2017-06-14 21:48:31 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-27 22:36:46 +0100 |
commit | 55f8db02465f2aaadf9fb8ca63a7734b0e54435f (patch) | |
tree | 3cea64dc6272341618e4c7c4a8bcc80819164d59 /bitbake | |
parent | f505d9fad991d7c11dda94d9fdb5740f554a6424 (diff) | |
download | poky-55f8db02465f2aaadf9fb8ca63a7734b0e54435f.tar.gz |
bitbake: toaster: fail on layers with sub-layer
For layers directories with sub-layers (for example meta-intel),
Toaster breaks when trying to exact match a dependency event for
that sub-layer against the top level layer directory paths.
Given that top the level layer directory paths are unique, adding
a test to see if the dependency path is a subset of a top level
path is also unique.
Also, since a warning was issued the processing should not fail
on the assert but instead should continue and gather the recipes
and tasks.
[YOCTO #11149]
(Bitbake rev: e1c769eed2258bb2697e9558f484dd62a3da7399)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 46be5a50e4..3f8d63d1b6 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -981,6 +981,7 @@ class BuildInfoHelper(object): | |||
981 | pathRE = pathRE[:-1] | 981 | pathRE = pathRE[:-1] |
982 | 982 | ||
983 | p = re.compile(pathRE) | 983 | p = re.compile(pathRE) |
984 | path=re.sub(r'[$^]',r'',pathRE) | ||
984 | # Heuristics: we always match recipe to the deepest layer path in | 985 | # Heuristics: we always match recipe to the deepest layer path in |
985 | # the discovered layers | 986 | # the discovered layers |
986 | for lvo in sorted(self.orm_wrapper.layer_version_objects, | 987 | for lvo in sorted(self.orm_wrapper.layer_version_objects, |
@@ -990,12 +991,16 @@ class BuildInfoHelper(object): | |||
990 | if lvo.layer.local_source_dir: | 991 | if lvo.layer.local_source_dir: |
991 | if p.fullmatch(os.path.abspath(lvo.layer.local_source_dir)): | 992 | if p.fullmatch(os.path.abspath(lvo.layer.local_source_dir)): |
992 | return lvo | 993 | return lvo |
994 | if 0 == path.find(lvo.local_path): | ||
995 | # sub-layer path inside existing layer | ||
996 | return lvo | ||
993 | 997 | ||
994 | # if we get here, we didn't read layers correctly; | 998 | # if we get here, we didn't read layers correctly; |
995 | # dump whatever information we have on the error log | 999 | # dump whatever information we have on the error log |
996 | logger.warning("Could not match layer dependency for path %s : %s", | 1000 | logger.warning("Could not match layer dependency for path %s : %s", |
997 | pathRE, | 1001 | pathRE, |
998 | self.orm_wrapper.layer_version_objects) | 1002 | self.orm_wrapper.layer_version_objects) |
1003 | return None | ||
999 | 1004 | ||
1000 | def _get_layer_version_for_path(self, path): | 1005 | def _get_layer_version_for_path(self, path): |
1001 | self._ensure_build() | 1006 | self._ensure_build() |
@@ -1396,9 +1401,9 @@ class BuildInfoHelper(object): | |||
1396 | for lv in event._depgraph['layer-priorities']: | 1401 | for lv in event._depgraph['layer-priorities']: |
1397 | (_, path, _, priority) = lv | 1402 | (_, path, _, priority) = lv |
1398 | layer_version_obj = self._get_layer_version_for_dependency(path) | 1403 | layer_version_obj = self._get_layer_version_for_dependency(path) |
1399 | assert layer_version_obj is not None | 1404 | if layer_version_obj: |
1400 | layer_version_obj.priority = priority | 1405 | layer_version_obj.priority = priority |
1401 | layer_version_obj.save() | 1406 | layer_version_obj.save() |
1402 | 1407 | ||
1403 | # save recipe information | 1408 | # save recipe information |
1404 | self.internal_state['recipes'] = {} | 1409 | self.internal_state['recipes'] = {} |