diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-05 20:44:47 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-09 03:34:12 +0000 |
| commit | bcddeedc6f657841bf0cbb9cf06e9de1633bbe6d (patch) | |
| tree | a0c6fb90e4c6754a848af66e6b19102b40db6ddd /recipes-containers/vcontainer | |
| parent | ffa5f611925a0eef7a18ed3ce461f88424604afd (diff) | |
| download | meta-virtualization-bcddeedc6f657841bf0cbb9cf06e9de1633bbe6d.tar.gz | |
vcontainer: enable incremental builds by default
Previously, vcontainer recipes had [nostamp] flags that forced all
tasks to rebuild on every bitbake invocation, even when nothing changed.
This was added as a workaround for dependency tracking issues but caused
slow rebuild times.
Changes:
- Make [nostamp] conditional on VCONTAINER_FORCE_BUILD variable
- Default to normal stamp-based caching for faster incremental builds
- file-checksums on do_rootfs still tracks init script changes
- Add VCONTAINER_FORCE_BUILD status to the tarball build banner
To enable the old always-rebuild behavior (for debugging dependency
issues), set in local.conf:
VCONTAINER_FORCE_BUILD = "1"
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/vcontainer')
4 files changed, 38 insertions, 10 deletions
diff --git a/recipes-containers/vcontainer/vcontainer-initramfs-create.inc b/recipes-containers/vcontainer/vcontainer-initramfs-create.inc index 00ae5332..b50179d5 100644 --- a/recipes-containers/vcontainer/vcontainer-initramfs-create.inc +++ b/recipes-containers/vcontainer/vcontainer-initramfs-create.inc | |||
| @@ -33,10 +33,17 @@ EXCLUDE_FROM_WORLD = "1" | |||
| 33 | # No extraction tools needed - we use pre-built images | 33 | # No extraction tools needed - we use pre-built images |
| 34 | DEPENDS = "" | 34 | DEPENDS = "" |
| 35 | 35 | ||
| 36 | # Always rebuild - no sstate caching for this recipe | 36 | # Force rebuild control: |
| 37 | SSTATE_SKIP_CREATION = "1" | 37 | # Set VCONTAINER_FORCE_BUILD = "1" in local.conf to disable stamp caching |
| 38 | do_compile[nostamp] = "1" | 38 | # and force compile/deploy to always run. Useful when debugging dependency issues. |
| 39 | do_deploy[nostamp] = "1" | 39 | # Default: use normal stamp caching for faster incremental builds |
| 40 | VCONTAINER_FORCE_BUILD ?= "" | ||
| 41 | python () { | ||
| 42 | if d.getVar('VCONTAINER_FORCE_BUILD') == '1': | ||
| 43 | d.setVar('SSTATE_SKIP_CREATION', '1') | ||
| 44 | d.setVarFlag('do_compile', 'nostamp', '1') | ||
| 45 | d.setVarFlag('do_deploy', 'nostamp', '1') | ||
| 46 | } | ||
| 40 | 47 | ||
| 41 | # Only populate native sysroot, skip target sysroot to avoid libgcc conflicts | 48 | # Only populate native sysroot, skip target sysroot to avoid libgcc conflicts |
| 42 | INHIBIT_DEFAULT_DEPS = "1" | 49 | INHIBIT_DEFAULT_DEPS = "1" |
diff --git a/recipes-containers/vcontainer/vcontainer-tarball.bb b/recipes-containers/vcontainer/vcontainer-tarball.bb index 180f3c19..a4e9a9a5 100644 --- a/recipes-containers/vcontainer/vcontainer-tarball.bb +++ b/recipes-containers/vcontainer/vcontainer-tarball.bb | |||
| @@ -144,6 +144,15 @@ python () { | |||
| 144 | bb.plain(" To build only one architecture, set in local.conf:") | 144 | bb.plain(" To build only one architecture, set in local.conf:") |
| 145 | bb.plain(" VCONTAINER_ARCHITECTURES = \"x86_64\"") | 145 | bb.plain(" VCONTAINER_ARCHITECTURES = \"x86_64\"") |
| 146 | bb.plain(" VCONTAINER_ARCHITECTURES = \"aarch64\"") | 146 | bb.plain(" VCONTAINER_ARCHITECTURES = \"aarch64\"") |
| 147 | bb.plain("") | ||
| 148 | force = d.getVar('VCONTAINER_FORCE_BUILD') or '' | ||
| 149 | if force == '1': | ||
| 150 | bb.plain(" VCONTAINER_FORCE_BUILD = \"1\" (enabled)") | ||
| 151 | bb.plain(" All vcontainer tasks will rebuild unconditionally.") | ||
| 152 | else: | ||
| 153 | bb.plain(" Incremental builds enabled (default).") | ||
| 154 | bb.plain(" To force full rebuild, set in local.conf:") | ||
| 155 | bb.plain(" VCONTAINER_FORCE_BUILD = \"1\"") | ||
| 147 | bb.plain("=" * 70) | 156 | bb.plain("=" * 70) |
| 148 | bb.plain("") | 157 | bb.plain("") |
| 149 | } | 158 | } |
diff --git a/recipes-containers/vcontainer/vdkr-rootfs-image.bb b/recipes-containers/vcontainer/vdkr-rootfs-image.bb index 8dcf4190..0bcf40b6 100644 --- a/recipes-containers/vcontainer/vdkr-rootfs-image.bb +++ b/recipes-containers/vcontainer/vdkr-rootfs-image.bb | |||
| @@ -30,9 +30,15 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda | |||
| 30 | do_rootfs[file-checksums] += "${THISDIR}/files/vdkr-init.sh:True" | 30 | do_rootfs[file-checksums] += "${THISDIR}/files/vdkr-init.sh:True" |
| 31 | do_rootfs[file-checksums] += "${THISDIR}/files/vcontainer-init-common.sh:True" | 31 | do_rootfs[file-checksums] += "${THISDIR}/files/vcontainer-init-common.sh:True" |
| 32 | 32 | ||
| 33 | # Force do_rootfs to always run (no stamp caching) | 33 | # Force rebuild control: |
| 34 | # Combined with file-checksums, this ensures init script changes are picked up | 34 | # Set VCONTAINER_FORCE_BUILD = "1" in local.conf to disable stamp caching |
| 35 | do_rootfs[nostamp] = "1" | 35 | # and force rootfs to always rebuild. Useful when debugging dependency issues. |
| 36 | # Default: use normal stamp caching (file-checksums handles init script changes) | ||
| 37 | VCONTAINER_FORCE_BUILD ?= "" | ||
| 38 | python () { | ||
| 39 | if d.getVar('VCONTAINER_FORCE_BUILD') == '1': | ||
| 40 | d.setVarFlag('do_rootfs', 'nostamp', '1') | ||
| 41 | } | ||
| 36 | 42 | ||
| 37 | # Inherit from core-image-minimal for a minimal base | 43 | # Inherit from core-image-minimal for a minimal base |
| 38 | inherit core-image | 44 | inherit core-image |
diff --git a/recipes-containers/vcontainer/vpdmn-rootfs-image.bb b/recipes-containers/vcontainer/vpdmn-rootfs-image.bb index 644ce14d..5ca73953 100644 --- a/recipes-containers/vcontainer/vpdmn-rootfs-image.bb +++ b/recipes-containers/vcontainer/vpdmn-rootfs-image.bb | |||
| @@ -24,9 +24,15 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda | |||
| 24 | do_rootfs[file-checksums] += "${THISDIR}/files/vpdmn-init.sh:True" | 24 | do_rootfs[file-checksums] += "${THISDIR}/files/vpdmn-init.sh:True" |
| 25 | do_rootfs[file-checksums] += "${THISDIR}/files/vcontainer-init-common.sh:True" | 25 | do_rootfs[file-checksums] += "${THISDIR}/files/vcontainer-init-common.sh:True" |
| 26 | 26 | ||
| 27 | # Force do_rootfs to always run (no stamp caching) | 27 | # Force rebuild control: |
| 28 | # Combined with file-checksums, this ensures init script changes are picked up | 28 | # Set VCONTAINER_FORCE_BUILD = "1" in local.conf to disable stamp caching |
| 29 | do_rootfs[nostamp] = "1" | 29 | # and force rootfs to always rebuild. Useful when debugging dependency issues. |
| 30 | # Default: use normal stamp caching (file-checksums handles init script changes) | ||
| 31 | VCONTAINER_FORCE_BUILD ?= "" | ||
| 32 | python () { | ||
| 33 | if d.getVar('VCONTAINER_FORCE_BUILD') == '1': | ||
| 34 | d.setVarFlag('do_rootfs', 'nostamp', '1') | ||
| 35 | } | ||
| 30 | 36 | ||
| 31 | # Inherit from core-image-minimal for a minimal base | 37 | # Inherit from core-image-minimal for a minimal base |
| 32 | inherit core-image | 38 | inherit core-image |
