On Tue, Apr 4, 2023 at 11:36 PM Marek Vasut <ma...@denx.de> wrote:

> In case a LAYERDEPENDS of a tested layer contains a dependency which is
> present in additional layers, such dependency does not get pulled into
> the layer test as a dependency be default and instead of YCL stops and
> reports it cannot find dependent layers.
>

Hmm. I know this script is slightly (!) convoluted.
But I think this is done 'by design'. Since you are expected to list all
your dependencies with --dependency when you are testing a layer.


>
> An example of this is a layer with LAYERDEPENDS = " core openembedded-core
> "
> and then by running YCL on such layer using the following invocation:
> $ yocto-check-layer -d --additional-layers ../meta-openembedded/ --
> ../meta-board-distro
>

In this specific example, you are supposed to use --dependency
../meta-openembedded instead of --additional-layers, no?
--additional-layers (see 31e53430f1bb6f73b82698b20ef7f1047313214a) is
supposed to bring extra layers when parsing/testing to mimic a full distro
or to manually force optional layers to be present. But --dependency is
still required to contain all potential dependencies.


> ...
> ERROR: Layer meta-board-distro depends on openembedded-layer and isn't
> found.
> ...
>
> The fix here adds all layers in the --additional-layers list into layers
> which are searched for dependencies of the tested layer. That way, even
> layers present in additional-layers list are searched and possibly used
> as dependencies for the layer check.
>
> Signed-off-by: Marek Vasut <ma...@denx.de>
> ---
> Cc: Alexandre Belloni <alexandre.bell...@bootlin.com>
> Cc: Nicolas Dechesne <nicolas.deche...@linaro.org>
> Cc: Richard Purdie <richard.pur...@linuxfoundation.org>
> ---
>  scripts/yocto-check-layer | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer
> index 67cc71950f..fbb715c0af 100755
> --- a/scripts/yocto-check-layer
> +++ b/scripts/yocto-check-layer
> @@ -144,7 +144,7 @@ def main():
>      if not args.no_auto_dependency:
>          depends = []
>          for layer in layers:
> -            layer_depends = get_layer_dependencies(layer, dep_layers,
> logger)
> +            layer_depends = get_layer_dependencies(layer, dep_layers +
> additional_layers, logger)
>              if layer_depends:
>                  for d in layer_depends:
>                      if d not in depends:
> @@ -188,7 +188,7 @@ def main():
>          missing_dependencies = not add_layer_dependencies(bblayersconf,
> layer, dep_layers, logger)
>          if not missing_dependencies:
>              for additional_layer in additional_layers:
> -                if not add_layer_dependencies(bblayersconf,
> additional_layer, dep_layers, logger):
> +                if not add_layer_dependencies(bblayersconf,
> additional_layer, dep_layers + additional_layers, logger):
>                      missing_dependencies = True
>                      break
>          if missing_dependencies:
> --
> 2.39.2
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#179723): 
https://lists.openembedded.org/g/openembedded-core/message/179723
Mute This Topic: https://lists.openembedded.org/mt/98069983/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to