[2/2] CI: fix check-layer indeterminism

Message ID 20220124174012.3916927-2-ross.burton@arm.com
State New
Headers show
Series [1/2] CI: update for meta-zephyr changes | expand

Commit Message

Ross Burton Jan. 24, 2022, 5:40 p.m. UTC
yocto-check-layers is very greedy when searching for layers, and will
find the test layers in Bitbake if given the chance, for example:

bitbake/lib/layerindexlib/tests/testdata/layer4

This layer has the collection name openembedded-layer and is only
compatible with Sumo.  The selection of layer from collection name is
not deterministic, so it's possible that this layer is selected which
then fails the check as it isn't compatible.

Solve this by restricting the dependency layers in meta-arm to just
meta-arm/meta-*, so it doesn't recurse into meta-arm/work/poky/bitbake.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Denys Dmytriyenko Jan. 24, 2022, 6:06 p.m. UTC | #1
On Mon, Jan 24, 2022 at 05:40:12PM +0000, Ross Burton wrote:
> yocto-check-layers is very greedy when searching for layers, and will
> find the test layers in Bitbake if given the chance, for example:
> 
> bitbake/lib/layerindexlib/tests/testdata/layer4
> 
> This layer has the collection name openembedded-layer and is only
> compatible with Sumo.  The selection of layer from collection name is
> not deterministic, so it's possible that this layer is selected which
> then fails the check as it isn't compatible.
> 
> Solve this by restricting the dependency layers in meta-arm to just
> meta-arm/meta-*, so it doesn't recurse into meta-arm/work/poky/bitbake.

FWIW, I've fallen into this trap before - should this Sumo remnant be removed 
from Bitbake then?


> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  .gitlab-ci.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 9a60f672..4c5d74e9 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -79,7 +79,7 @@ check-layers:
>    extends: .setup
>    script:
>      - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml --command \
> -      "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
> +      "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
>    parallel:
>      matrix:
>        - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain, meta-gem5]
> -- 
> 2.25.1
>
Ross Burton Jan. 24, 2022, 6:24 p.m. UTC | #2
On Mon, 24 Jan 2022 at 18:06, Denys Dmytriyenko <denis@denix.org> wrote:
> FWIW, I've fallen into this trap before - should this Sumo remnant be removed
> from Bitbake then?

No, the layer shouldn't be found in the first place.  I'm adding a
check to the tool so that if the layer searching goes a bit haywire
and finds these it aborts early instead of giving weird failures.

Ross

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9a60f672..4c5d74e9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -79,7 +79,7 @@  check-layers:
   extends: .setup
   script:
     - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml --command \
-      "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
+      "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
   parallel:
     matrix:
       - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain, meta-gem5]