public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Adriaan Schmidt <adriaan.schmidt@siemens.com>
To: isar-users@googlegroups.com
Cc: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Subject: [PATCH v5 03/13] rootfs: recursively depend on packages
Date: Thu,  4 Nov 2021 12:51:13 +0100	[thread overview]
Message-ID: <20211104115123.2519356-4-adriaan.schmidt@siemens.com> (raw)
In-Reply-To: <20211104115123.2519356-1-adriaan.schmidt@siemens.com>

This specifies dependencies more precisely, which becomes
important when we introduce caching.

The current definition of deptask can lead to errors, e.g.:
If rootfs includes A which depends on B, then currently rootfs
depends on A's do_deploy_deb, but only A's do_prepare_build
depends on B's do_deploy_deb. So if we can produce A from cache
without running its do_prepare_build, B might not be there.
This is of course never observed when building from scratch.

Setting recrdeptask instead fixes this, which is also how it's
done in OE.

The same thing can happen when building packages. Unfortunately
setting `do_prepare_build[recrdeptask] = "do_deploy_deb"`
makes a recipes do_prepare_build depend on its own do_deploy_deb,
creating a dependency loop. This is solved by making do_deploy_deb
depend on the do_deploy_deb task of dependent recipes. Not precisely
what we want, but should have the same effect.

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
---
 meta/classes/dpkg-base.bbclass | 1 +
 meta/classes/rootfs.bbclass    | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 8a39a6d..2005707 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -244,6 +244,7 @@ do_deploy_deb() {
 }
 
 addtask deploy_deb after do_dpkg_build before do_build
+do_deploy_deb[deptask] = "do_deploy_deb"
 do_deploy_deb[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
 do_deploy_deb[dirs] = "${S}"
 
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 20ccb00..b38de66 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -153,7 +153,7 @@ rootfs_install_pkgs_install() {
 do_rootfs_install[root_cleandirs] = "${ROOTFSDIR}"
 do_rootfs_install[vardeps] += "${ROOTFS_CONFIGURE_COMMAND} ${ROOTFS_INSTALL_COMMAND}"
 do_rootfs_install[depends] = "isar-bootstrap-${@'target' if d.getVar('ROOTFS_ARCH') == d.getVar('DISTRO_ARCH') else 'host'}:do_build"
-do_rootfs_install[deptask] = "do_deploy_deb"
+do_rootfs_install[recrdeptask] = "do_deploy_deb"
 python do_rootfs_install() {
     configure_cmds = (d.getVar("ROOTFS_CONFIGURE_COMMAND", True) or "").split()
     install_cmds = (d.getVar("ROOTFS_INSTALL_COMMAND", True) or "").split()
-- 
2.30.2


  parent reply	other threads:[~2021-11-04 11:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 11:51 [PATCH v5 00/13] Add sstate-cache Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 01/13] oe imports in central location Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 02/13] images: create deploy dir Adriaan Schmidt
2021-11-04 11:51 ` Adriaan Schmidt [this message]
2021-11-04 11:51 ` [PATCH v5 04/13] base: remove unneeded "before do_build" task dependencies Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 05/13] dpkg: add explicit dependency to isar-apt Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 06/13] meta: add sstate feature from oe Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 07/13] sstate: configure Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 08/13] sstate: add caching to isar-bootstrap Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 09/13] sstate: add caching to rootfs Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 10/13] sstate: add caching to debian packages Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 11/13] test: pass absolute path for build_dir Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 12/13] test: make bitbake_args a list Adriaan Schmidt
2021-11-04 11:51 ` [PATCH v5 13/13] sstate: add test case Adriaan Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211104115123.2519356-4-adriaan.schmidt@siemens.com \
    --to=adriaan.schmidt@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox