From: Zhihang Wei <wzh@ilbers.de>
To: Felix Moessbauer <felix.moessbauer@siemens.com>,
isar-users@googlegroups.com
Cc: jan.kiszka@siemens.com
Subject: Re: [PATCH 1/1] fix(dpkg-build): deploy debs via shared sstate dir
Date: Fri, 31 Jul 2026 11:26:17 +0200 [thread overview]
Message-ID: <2fee4d7a-52e6-4cf5-90d0-2485a3b43bdb@ilbers.de> (raw)
In-Reply-To: <20260729111820.3676623-1-felix.moessbauer@siemens.com>
On 7/29/26 13:18, 'Felix Moessbauer' via isar-users wrote:
> The built debs were stored in a WORKDIR-internal plaindir and consumed
> from there by do_deploy_deb. do_deploy_deb is a task that mutates
> the external isar-apt repository and can therefore never be sstate
> cached, so it always runs and relies on the plaindir being present on
> disk.
>
> When do_dpkg_build is served from the sstate cache, that WORKDIR-internal
> plaindir is not guaranteed to be materialized (e.g. when the task is
> covered via hash equivalence without a setscene restore). do_deploy_deb
> then runs against an empty deploy dir, passes an unexpanded glob to
> dpkg-deb and aborts the build.
>
> Fix it by deploying the debs into a shared, sstate-tracked DEPLOY_DIR_DEB
> via sstate-inputdirs/sstate-outputdirs.
>
> Fixes: 3363ff57 ("dpkg: directly deploy via sstate cache")
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
> RECIPE-API-CHANGELOG.md | 8 ++++++++
> doc/technical_overview.md | 2 +-
> meta/classes-recipe/barebox.bbclass | 4 ++--
> meta/classes-recipe/dpkg-base.bbclass | 19 ++++++++++++++-----
> 4 files changed, 25 insertions(+), 8 deletions(-)
>
<snip>
> diff --git a/meta/classes-recipe/dpkg-base.bbclass b/meta/classes-recipe/dpkg-base.bbclass
> index bc53e4bd..4a81787e 100644
> --- a/meta/classes-recipe/dpkg-base.bbclass
> +++ b/meta/classes-recipe/dpkg-base.bbclass
> @@ -12,7 +12,12 @@ inherit repository
> inherit deb-dl-dir
> inherit essential
>
> +# Local (WORKDIR-internal) dir where do_dpkg_build collects the built debs.
> +# Its content is exported into the shared, sstate-tracked DEPLOY_DIR_DEB so
> +# that consumers (do_deploy_deb) always find the artifacts, independent of the
> +# WORKDIR lifecycle.
> DEPLOYDIR = "${WORKDIR}/deploy"
> +DEPLOY_DIR_DEB = "${DEPLOY_DIR}/isar-deb/${DISTRO}-${DISTRO_ARCH}/${PN}"
>
> DEPENDS ?= ""
> RPROVIDES ?= "${PROVIDES}"
> @@ -200,7 +205,8 @@ python do_dpkg_build() {
> bb.build.exec_func('dpkg_chroot_finalize', d)
> }
> do_dpkg_build[cleandirs] = "${DEPLOYDIR}"
> -do_dpkg_build[sstate-plaindirs] = "${DEPLOYDIR}"
> +do_dpkg_build[sstate-inputdirs] = "${DEPLOYDIR}"
> +do_dpkg_build[sstate-outputdirs] = "${DEPLOY_DIR_DEB}"
> do_dpkg_build[network] = "${TASK_USE_NETWORK_AND_SUDO}"
> do_dpkg_build[depends] = "${SCHROOT_DEP} base-apt:do_cache isar-apt:do_cache_config"
Can you send a rebase? The line above does not match with current next.
Zhihang
> do_dpkg_build[postfuncs] += "dpkg_collect_debs"
> @@ -218,7 +224,7 @@ addtask dpkg_build_setscene
> CLEANFUNCS += "deb_clean"
>
> deb_clean() {
> - DEBS=$( find ${DEPLOYDIR} -maxdepth 1 -name "*.deb" || [ ! -d ${S} ] )
> + DEBS=$( find ${DEPLOY_DIR_DEB} -maxdepth 1 -name "*.deb" || [ ! -d ${S} ] )
> if [ -n "${DEBS}" ]; then
> for d in ${DEBS}; do
> repo_del_package "${REPO_ISAR_DIR}"/"${DISTRO}" \
> @@ -232,8 +238,11 @@ do_clean[network] = "${TASK_USE_SUDO}"
>
> do_deploy_deb() {
> deb_clean
> - repo_add_packages "${REPO_ISAR_DIR}"/"${DISTRO}" \
> - "${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}" ${DEPLOYDIR}/*.deb
> + debs=$(find ${DEPLOY_DIR_DEB} -maxdepth 1 -name '*.deb')
> + if [ -n "${debs}" ]; then
> + repo_add_packages "${REPO_ISAR_DIR}"/"${DISTRO}" \
> + "${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}" ${debs}
> + fi
> }
>
> addtask deploy_deb after do_dpkg_build before do_build
> @@ -241,7 +250,7 @@ do_deploy_deb[deptask] = "do_deploy_deb"
> do_deploy_deb[rdeptask] = "do_deploy_deb"
> do_deploy_deb[depends] += "isar-apt:do_cache_config"
> do_deploy_deb[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
> -do_deploy_deb[dirs] = "${S}"
> +do_deploy_deb[dirs] = "${S} ${DEPLOY_DIR_DEB}"
>
> python do_devshell() {
> isar_export_proxies(d)
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/2fee4d7a-52e6-4cf5-90d0-2485a3b43bdb%40ilbers.de.
next prev parent reply other threads:[~2026-07-31 9:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 11:18 'Felix Moessbauer' via isar-users
2026-07-30 14:41 ` 'Jan Kiszka' via isar-users
2026-07-30 15:12 ` 'MOESSBAUER, Felix' via isar-users
2026-07-31 9:26 ` Zhihang Wei [this message]
2026-07-31 10:10 ` 'MOESSBAUER, Felix' via isar-users
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=2fee4d7a-52e6-4cf5-90d0-2485a3b43bdb@ilbers.de \
--to=wzh@ilbers.de \
--cc=felix.moessbauer@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.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