diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-09 19:58:56 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-09 20:03:27 +0000 |
| commit | d79d3d2a449054b700f66fe04532f11c1c72c65a (patch) | |
| tree | ea3d2eee1ef3d80978e9dbbe70d95a26f0157852 /classes/container-bundle.bbclass | |
| parent | ed5b33932e5f9ad8dc530a53fddfc865fc60d60c (diff) | |
| download | meta-virtualization-d79d3d2a449054b700f66fe04532f11c1c72c65a.tar.gz | |
vcontainer: fix yocto-check-layer mcdepends parse error
Fix yocto-check-layer failure:
ERROR: Multiconfig dependency mc::vruntime-x86-64:vpdmn-initramfs-create:do_deploy
depends on nonexistent multiconfig configuration named configuration vruntime-x86-64
Several recipes and classes declared static mcdepends referencing
vruntime-aarch64 and vruntime-x86-64 multiconfigs. When parsed without
BBMULTICONFIG set (e.g. yocto-check-layer), BitBake validates these and
fails because the referenced multiconfigs don't exist.
Move mcdepends into anonymous python functions and only set them when
the target multiconfig exists in BBMULTICONFIG, following the pattern
established in meta/classes-recipe/kernel-fit-image.bbclass.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'classes/container-bundle.bbclass')
| -rw-r--r-- | classes/container-bundle.bbclass | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/classes/container-bundle.bbclass b/classes/container-bundle.bbclass index 3c8ad030..53b7b2f8 100644 --- a/classes/container-bundle.bbclass +++ b/classes/container-bundle.bbclass | |||
| @@ -215,6 +215,14 @@ def is_remote_container(source): | |||
| 215 | return '/' in base or '.' in base | 215 | return '/' in base or '.' in base |
| 216 | 216 | ||
| 217 | python __anonymous() { | 217 | python __anonymous() { |
| 218 | # Conditionally set mcdepends when vruntime multiconfig is configured | ||
| 219 | # (avoids parse errors when BBMULTICONFIG is not set, e.g. yocto-check-layer) | ||
| 220 | vruntime_mc = d.getVar('VRUNTIME_MULTICONFIG') | ||
| 221 | bbmulticonfig = (d.getVar('BBMULTICONFIG') or "").split() | ||
| 222 | if vruntime_mc and vruntime_mc in bbmulticonfig: | ||
| 223 | d.setVarFlag('do_compile', 'mcdepends', | ||
| 224 | 'mc::%s:vdkr-initramfs-create:do_deploy mc::%s:vpdmn-initramfs-create:do_deploy' % (vruntime_mc, vruntime_mc)) | ||
| 225 | |||
| 218 | bundles = (d.getVar('CONTAINER_BUNDLES') or "").split() | 226 | bundles = (d.getVar('CONTAINER_BUNDLES') or "").split() |
| 219 | if not bundles: | 227 | if not bundles: |
| 220 | return | 228 | return |
| @@ -486,12 +494,7 @@ do_install() { | |||
| 486 | 494 | ||
| 487 | FILES:${PN} = "${datadir}/container-bundles" | 495 | FILES:${PN} = "${datadir}/container-bundles" |
| 488 | 496 | ||
| 489 | # Automatically trigger multiconfig blob builds | 497 | # mcdepends set conditionally in __anonymous() above |
| 490 | # Note: This does NOT create circular dependencies because the blob build chain | ||
| 491 | # (vdkr/vpdmn-initramfs-create -> vdkr/vpdmn-rootfs-image) is completely separate | ||
| 492 | # from container image recipes. Circular deps only occur if bundle packages are | ||
| 493 | # globally added to all images (including container images themselves). | ||
| 494 | do_compile[mcdepends] = "mc::${VRUNTIME_MULTICONFIG}:vdkr-initramfs-create:do_deploy mc::${VRUNTIME_MULTICONFIG}:vpdmn-initramfs-create:do_deploy" | ||
| 495 | 498 | ||
| 496 | # =========================================================================== | 499 | # =========================================================================== |
| 497 | # Optional Deploy for OCI Base Layer Usage | 500 | # Optional Deploy for OCI Base Layer Usage |
