All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] toaster: sub-layer dependency matching
@ 2017-06-15  4:48 David Reyna
  2017-06-15  4:48 ` [PATCH 1/1] toaster: fail on layers with sub-layer David Reyna
  0 siblings, 1 reply; 2+ messages in thread
From: David Reyna @ 2017-06-15  4:48 UTC (permalink / raw)
  To: bitbake-devel

From: David Reyna <David.Reyna@windriver.com>

Support layers directories with sub-layers (for example meta-intel).
Toaster surrently breaks when trying to exact match a dependency event for
that sub-layer against the top level layer directory paths.

The following changes since commit 6964efddd31c479386d1643c1025bc102710392f:

  bitbake: cooker: ensure graceful exit after exception during BuildCompleted handler (2017-06-14 14:54:25 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib dreyna/submit/dreyna/toaster/sub_layer_fail_11149
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=dreyna/submit/dreyna/toaster/sub_layer_fail_11149

David Reyna (1):
  toaster: fail on layers with sub-layer

 lib/bb/ui/buildinfohelper.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] toaster: fail on layers with sub-layer
  2017-06-15  4:48 [PATCH 0/1] toaster: sub-layer dependency matching David Reyna
@ 2017-06-15  4:48 ` David Reyna
  0 siblings, 0 replies; 2+ messages in thread
From: David Reyna @ 2017-06-15  4:48 UTC (permalink / raw)
  To: bitbake-devel

From: David Reyna <David.Reyna@windriver.com>

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]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
 lib/bb/ui/buildinfohelper.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index 46be5a5..3f8d63d 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -981,6 +981,7 @@ class BuildInfoHelper(object):
             pathRE = pathRE[:-1]
 
         p = re.compile(pathRE)
+        path=re.sub(r'[$^]',r'',pathRE)
         # Heuristics: we always match recipe to the deepest layer path in
         # the discovered layers
         for lvo in sorted(self.orm_wrapper.layer_version_objects,
@@ -990,12 +991,16 @@ class BuildInfoHelper(object):
             if lvo.layer.local_source_dir:
                 if p.fullmatch(os.path.abspath(lvo.layer.local_source_dir)):
                     return lvo
+            if 0 == path.find(lvo.local_path):
+                # sub-layer path inside existing layer
+                return lvo
 
         # if we get here, we didn't read layers correctly;
         # dump whatever information we have on the error log
         logger.warning("Could not match layer dependency for path %s : %s",
                        pathRE,
                        self.orm_wrapper.layer_version_objects)
+        return None
 
     def _get_layer_version_for_path(self, path):
         self._ensure_build()
@@ -1396,9 +1401,9 @@ class BuildInfoHelper(object):
             for lv in event._depgraph['layer-priorities']:
                 (_, path, _, priority) = lv
                 layer_version_obj = self._get_layer_version_for_dependency(path)
-                assert layer_version_obj is not None
-                layer_version_obj.priority = priority
-                layer_version_obj.save()
+                if layer_version_obj:
+                    layer_version_obj.priority = priority
+                    layer_version_obj.save()
 
         # save recipe information
         self.internal_state['recipes'] = {}
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-15  4:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15  4:48 [PATCH 0/1] toaster: sub-layer dependency matching David Reyna
2017-06-15  4:48 ` [PATCH 1/1] toaster: fail on layers with sub-layer David Reyna

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.