[v2,2/3] rootfs: Do not recursively build unneeded packages

Message ID 20251118143523.2326879-3-anaumann@emlix.com
State New
Headers show
Series test and fix transitive multiarch dependencies | expand

Commit Message

Andreas Naumann Nov. 18, 2025, 2:35 p.m. UTC
Using recrdeptask has the side effect that every package of which a task
appears in the dependency chain, will be built and deployed, even if just a
subset of tasks was needed to fulfil an inter-task dependency.

For coupled packages like the native/compat ones, which can share part of
their tasks, see 2ca3a7e  dpkg-source: Build source package only once,
this leads to a full build of the base package, while e.g. only the native
part needed to be produced.

Refrain from doing so by going back to using deptask which only adds the deploy
task of the direct dependencies and rely on correct cache and inter-task
settings of the used classes/recipes.
Add rdeptask handling to allow for runtime dependency settings.

This is a partial revert of 7c7628e  rootfs: recursively depend on packages.

This fixes build failures with custom "any" packages which dont support
crosscompiling (-native only), improves performance as no unneeded compiling is
being done.

Signed-off-by: Andreas Naumann <anaumann@emlix.com>
---
 meta/classes/rootfs.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index e1179e61..e12e1b8a 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -387,7 +387,8 @@  do_rootfs_install[root_cleandirs] = "${ROOTFSDIR}"
 do_rootfs_install[vardeps] += "${ROOTFS_CONFIGURE_COMMAND} ${ROOTFS_INSTALL_COMMAND}"
 do_rootfs_install[vardepsexclude] += "IMAGE_ROOTFS"
 do_rootfs_install[depends] = "bootstrap-${@'target' if d.getVar('ROOTFS_ARCH') == d.getVar('DISTRO_ARCH') else 'host'}:do_build"
-do_rootfs_install[recrdeptask] = "do_deploy_deb"
+do_rootfs_install[deptask] = "do_deploy_deb"
+do_rootfs_install[rdeptask] = "do_deploy_deb"
 do_rootfs_install[network] = "${TASK_USE_SUDO}"
 python do_rootfs_install() {
     configure_cmds = (d.getVar("ROOTFS_CONFIGURE_COMMAND") or "").split()