diff options
author | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2018-09-24 17:07:54 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-25 23:15:49 +0100 |
commit | 705941f8c3d2b522cd4bef7c5fe72771c40c8688 (patch) | |
tree | 34062557db59f882d68aaad439fcfa5b4e6acc66 /scripts/lib/checklayer | |
parent | e3bca3c8d06b7debdfa9472474beb5f475eb5e59 (diff) | |
download | poky-705941f8c3d2b522cd4bef7c5fe72771c40c8688.tar.gz |
checklayer: avoid recursive loop in add_layer_dependencies
When Layer A and Layer B depend on each other, then we will end up in a
recursive loop in function recurse_dependencies(). To avoid such situation
before making the recursive function call we check whether or not we have
already processed this layer.
e.g. without this patch, running this script on layers with dependency loops, we are seeing:
$ yocto-check-layer -d /srv/work/oe/meta-openembedded/
INFO: Detected layers:
INFO: meta-python: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-python
INFO: meta-filesystems: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-filesystems
INFO: meta-gnome: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-gnome
INFO: meta-xfce: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-xfce
INFO: meta-networking: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-networking
INFO: meta-initramfs: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-initramfs
INFO: meta-oe: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-oe
INFO: meta-multimedia: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-multimedia
INFO: meta-perl: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-perl
INFO: meta-webserver: LayerType.SOFTWARE, /srv/work/oe/meta-openembedded/meta-webserver
INFO:
INFO: Setting up for meta-python(LayerType.SOFTWARE), /srv/work/oe/meta-openembedded/meta-python
DEBUG: Processing dependencies core openembedded-layer for layer meta-python.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
DEBUG: Processing dependencies core networking-layer for layer meta-oe.
DEBUG: Processing dependencies core openembedded-layer meta-python for layer meta-networking.
...
...
...
[keep repeating]
This patch fixes this situation.
(From OE-Core rev: 171900b4bcb06416685ce90b63114a10fefe0b94)
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/checklayer')
-rw-r--r-- | scripts/lib/checklayer/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index 2618416fab..7788041843 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py | |||
@@ -167,6 +167,10 @@ def add_layer_dependencies(bblayersconf, layer, layers, logger): | |||
167 | # multiple errors at once | 167 | # multiple errors at once |
168 | if ret is not None and layer_depend not in ret: | 168 | if ret is not None and layer_depend not in ret: |
169 | ret.append(layer_depend) | 169 | ret.append(layer_depend) |
170 | else: | ||
171 | # we might have processed this dependency already, in which case | ||
172 | # we should not do it again (avoid recursive loop) | ||
173 | continue | ||
170 | 174 | ||
171 | # Recursively process... | 175 | # Recursively process... |
172 | if 'collections' not in layer_depend: | 176 | if 'collections' not in layer_depend: |