From: Adriaan Schmidt <adriaan.schmidt@siemens.com>
To: <isar-users@googlegroups.com>
Cc: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Subject: [PATCH v2 4/7] dpkg-base: refactor dependencies of apt_* tasks
Date: Mon, 9 May 2022 12:16:01 +0200 [thread overview]
Message-ID: <20220509101604.3249558-5-adriaan.schmidt@siemens.com> (raw)
In-Reply-To: <20220509101604.3249558-1-adriaan.schmidt@siemens.com>
Only recipes with `apt://` sources in their SRC_URI run the three tasks
`apt_fetch`, `apt_unpack`, and `cleanall_apt`. The current implementation
creates the tasks (and dependencies) for all recipes and sets them to
`noexec` if they are not needed.
It turns out that bitbake doesn't generate sstate signatures for `noexec`
tasks, but carries them as dependencies to other tasks, which can break
analysis with sstate-diffsigs. Also, I suspect that `noexec` may not have
been designed as "optional", to be added in this way (OE never does this).
The new implementation only adds the three tasks when they are required.
It also:
- removes the dependency of `apt_fetch after do_unpack`
- makes `install_builddeps` depend explicitly on `${BUILDCHROOT_DEP}`,
a dependency which was previously only given via the `apt_fetch` task.
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
---
meta/classes/dpkg-base.bbclass | 14 ++++++--------
meta/classes/dpkg.bbclass | 2 +-
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 86933c57..fe6d46dd 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -95,10 +95,9 @@ python() {
d.setVar('SRC_URI', ' '.join(new_src_uri))
d.prependVar('SRC_APT', ' '.join(src_apt))
- if d.getVar('SRC_APT').strip() == '':
- d.setVarFlag('do_apt_fetch', 'noexec', '1')
- d.setVarFlag('do_apt_unpack', 'noexec', '1')
- d.setVarFlag('do_cleanall_apt', 'noexec', '1')
+ if len(d.getVar('SRC_APT').strip()) > 0:
+ bb.build.addtask('apt_unpack', 'do_patch', '', d)
+ bb.build.addtask('cleanall_apt', 'do_cleanall', '', d)
}
do_apt_fetch() {
@@ -117,11 +116,11 @@ do_apt_fetch() {
dpkg_undo_mounts
}
-addtask apt_fetch after do_unpack before do_apt_unpack
+addtask apt_fetch
do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
# Add dependency from the correct buildchroot: host or target
-do_apt_fetch[depends] = "${BUILDCHROOT_DEP}"
+do_apt_fetch[depends] += "${BUILDCHROOT_DEP}"
do_apt_unpack() {
rm -rf ${S}
@@ -142,9 +141,8 @@ do_apt_unpack() {
dpkg_undo_mounts
}
-addtask apt_unpack after do_apt_fetch before do_patch
+addtask apt_unpack after do_apt_fetch
-addtask cleanall_apt before do_cleanall
do_cleanall_apt[nostamp] = "1"
do_cleanall_apt() {
for uri in "${SRC_APT}"; do
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 320102ba..af833536 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -26,7 +26,7 @@ do_install_builddeps() {
}
addtask install_builddeps after do_prepare_build before do_dpkg_build
-do_install_builddeps[depends] += "isar-apt:do_cache_config"
+do_install_builddeps[depends] += "${BUILDCHROOT_DEP} isar-apt:do_cache_config"
# apt and reprepro may not run in parallel, acquire the Isar lock
do_install_builddeps[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
--
2.30.2
next prev parent reply other threads:[~2022-05-09 10:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-09 10:15 [PATCH v2 0/7] Sstate maintenance script Adriaan Schmidt
2022-05-09 10:15 ` [PATCH v2 1/7] meta-isar: improve cachability Adriaan Schmidt
2022-05-09 10:15 ` [PATCH v2 2/7] bitbake-diffsigs: make finding of changed signatures more robust Adriaan Schmidt
2022-05-09 10:16 ` [PATCH v2 3/7] bitbake-diffsigs: break on first dependent task difference Adriaan Schmidt
2022-05-09 10:16 ` Adriaan Schmidt [this message]
2022-05-09 10:16 ` [PATCH v2 5/7] scripts: add isar-sstate Adriaan Schmidt
2022-05-09 10:16 ` [PATCH v2 6/7] isar-sstate: add tool to check for caching issues Adriaan Schmidt
2022-05-09 10:16 ` [PATCH v2 7/7] testsuite: add cachability analysis to sstate test Adriaan Schmidt
2022-05-18 11:02 ` [PATCH v2 0/7] Sstate maintenance script Anton Mikanovich
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=20220509101604.3249558-5-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