Skip to content

Commit

Permalink
ci: yocto-check-layer: ensure KAS workspace is outside of the repo
Browse files Browse the repository at this point in the history
In the Github actions for yocto-check-layer, we can see the following
error:

INFO: Traceback (most recent call last):
  File "/opt/actions-runner/_work/meta-qcom-hwe/meta-qcom-hwe/poky/scripts/lib/checklayer/cases/common.py", line 87, in test_patches_upstream_status
    self.assertEqual(len(patches), 0 , \
AssertionError: 1 != 0 : Found following patches with malformed or missing upstream status:
/opt/actions-runner/_work/meta-qcom-hwe/meta-qcom-hwe/poky/meta/lib/oeqa/manual/abat.patch

Since KAS_WORK_DIR is not set, and since kas is executed from inside
the repo, we end up cloning poky and meta-qcom inside meta-qcom-hwe
repo. As such yocto-check-layer will 'parse' the entire poky (and
meta-qcom) repo , especially when looking for .patch files. Arguably
yocto-check-layer could be smarter and skip .patch files not
referenced in a valid recipe.. but it's not the case.

So we need to ensure that we checkout the kas workspace outside of our
repo. With this patch we either let the caller manage KAS_WORK_DIR, or
we create a temporary directory ourselves (typically in Github Actions).

This patch fixes the error mentioned above.

Signed-off-by: Nicolas Dechesne <[email protected]>
  • Loading branch information
ndechesne authored and ricardosalveti committed Nov 20, 2024
1 parent 4d1852e commit 0549425
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ci/yocto-check-layer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@

TOPDIR=$(realpath $(dirname $(readlink -f $0))/..)

# Ensure KAS workspace is outside of the checked out repo
# Allows the caller to specify KAS_WORK_DIR, otherwise make temp one
export KAS_WORK_DIR=$(realpath ${KAS_WORK_DIR:-$(mktemp -d)})

# Yocto Project layer checking tool
CMD="yocto-check-layer-wrapper"
# Layer to check
CMD="$CMD $TOPDIR"
# Disable auto layer discovery
CMD="$CMD --no-auto"
# Layers to process for dependencies
CMD="$CMD --dependency `pwd`/poky/meta `pwd`/meta-qcom"
CMD="$CMD --dependency $KAS_WORK_DIR/poky/meta $KAS_WORK_DIR/meta-qcom"
# Disable automatic testing of dependencies
CMD="$CMD --no-auto-dependency"
# Set machines to all machines defined in this BSP layer
CMD="$CMD --machines $(echo $(find $TOPDIR/conf/machine/ -maxdepth 1 -name *.conf -exec basename {} .conf \; ))"

echo "Running kas in $KAS_WORK_DIR"
exec kas shell $TOPDIR/ci/base.yml --command "$CMD"

0 comments on commit 0549425

Please sign in to comment.