public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'MOESSBAUER, Felix' via isar-users" <isar-users@googlegroups.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "wzh@ilbers.de" <wzh@ilbers.de>
Subject: Re: [PATCH v2 2/2] dpkg: directly deploy via sstate cache
Date: Thu, 23 Jul 2026 10:16:22 +0000	[thread overview]
Message-ID: <a7719ebf80e1414a57799974e4934303f68bdba5.camel@siemens.com> (raw)
In-Reply-To: <20260721150415.845260-2-felix.moessbauer@siemens.com>

On Tue, 2026-07-21 at 17:04 +0200, Felix Moessbauer wrote:
> By that, we can get rid of the custom sstate logic, which should be
> avoided if not needed. Further, the deploy process is now cleaner, as we
> deploy from a dedicated dir instead of the WORKDIR.
> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
> Changes since v1:
> 
> - adapt barebox.bbclass to deploy from DEPLOYDIR instead of WORKDIR
> 
>  doc/technical_overview.md             |  2 +-
>  meta/classes-recipe/barebox.bbclass   |  4 +--
>  meta/classes-recipe/dpkg-base.bbclass | 37 +++++++++------------------
>  3 files changed, 15 insertions(+), 28 deletions(-)
> 
> diff --git a/doc/technical_overview.md b/doc/technical_overview.md
> index f7e00f7b..fe427cae 100644
> --- a/doc/technical_overview.md
> +++ b/doc/technical_overview.md
> @@ -217,7 +217,7 @@ Both consist of the following steps:
>     finally unmount again (`dpkg_undo_mounts`).
>  
>  6. Task `do_deploy_deb`: add successfully built packages
> -   `${WORKDIR}/*.deb` to the isar-apt repository
> +   `${DEPLOYDIR}/*.deb` to the isar-apt repository
>     `${REPO_ISAR_DIR}/${DISTRO}`
>  
>  ## 3.6 Populate Target Filesystem
> diff --git a/meta/classes-recipe/barebox.bbclass b/meta/classes-recipe/barebox.bbclass
> index 45d77e3c..c9a767d5 100644
> --- a/meta/classes-recipe/barebox.bbclass
> +++ b/meta/classes-recipe/barebox.bbclass
> @@ -47,12 +47,12 @@ BAREBOX_BASE_BIN ?= "barebox"
>  
>  do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
>  do_deploy() {
> -    dpkg --fsys-tarfile ${WORKDIR}/${PN}_${CHANGELOG_V}_${DISTRO_ARCH}.deb | \
> +    dpkg --fsys-tarfile ${DEPLOYDIR}/${PN}_${CHANGELOG_V}_${DISTRO_ARCH}.deb | \
>          tar xOf - ./usr/lib/barebox/barebox.bin \
>          > "${DEPLOY_DIR_IMAGE}/${BAREBOX_BASE_BIN}.img"
>      ln -sf ${BAREBOX_BASE_BIN}.img ${DEPLOY_DIR_IMAGE}/barebox.bin
>  
> -    dpkg --fsys-tarfile ${WORKDIR}/${PN}_${CHANGELOG_V}_${DISTRO_ARCH}.deb | \
> +    dpkg --fsys-tarfile ${DEPLOYDIR}/${PN}_${CHANGELOG_V}_${DISTRO_ARCH}.deb | \
>          tar xOf - ./usr/lib/barebox/barebox.config \
>          > "${DEPLOY_DIR_IMAGE}/${BAREBOX_BASE_BIN}.config"
>      ln -sf ${BAREBOX_BASE_BIN}.config ${DEPLOY_DIR_IMAGE}/barebox.config
> diff --git a/meta/classes-recipe/dpkg-base.bbclass b/meta/classes-recipe/dpkg-base.bbclass
> index db912e90..e2ed4dfb 100644
> --- a/meta/classes-recipe/dpkg-base.bbclass
> +++ b/meta/classes-recipe/dpkg-base.bbclass
> @@ -12,6 +12,8 @@ inherit repository
>  inherit deb-dl-dir
>  inherit essential
>  
> +DEPLOYDIR = "${WORKDIR}/deploy"
> +
>  DEPENDS ?= ""
>  RPROVIDES ?= "${PROVIDES}"
>  
> @@ -186,6 +188,10 @@ dpkg_prepare_unshare_ccache() {
>      setfacl -m u:${UNSHARE_SUBUID_BASE}:rwX -m u:${@int(d.getVar('UNSHARE_SUBUID_BASE')) + 999}:rwx "${CCACHE_DIR}"
>  }
>  
> +dpkg_collect_debs() {
> +    find ${WORKDIR} -maxdepth 1 -name "*.deb" -exec mv {} ${DEPLOYDIR} \;
> +}
> +
>  python do_dpkg_build() {
>      bb.build.exec_func('dpkg_chroot_prepare', d)
>      try:
> @@ -193,45 +199,26 @@ python do_dpkg_build() {
>      finally:
>          bb.build.exec_func('dpkg_chroot_finalize', d)
>  }
> +do_dpkg_build[cleandirs] = "${DEPLOYDIR}"
> +do_dpkg_build[sstate-plaindirs] = "${DEPLOYDIR}"

Hi,

I'm currently playing around with using a hash equivalence server in
the testsuite (which brings major speedups on repeated runs and also
reduces the storage size needed). However, 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, breaking the build.

I already have fix for that which substitutes this patch. However,
depending on the timeline (and that this patch works in the current
mode), I'm wondering if I should send that as a replacement or as a
later improvement, together with a ton of sstate fixes that currently
remain unnoticed.

Felix

-- 
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/a7719ebf80e1414a57799974e4934303f68bdba5.camel%40siemens.com.

  reply	other threads:[~2026-07-23 10:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 15:04 [PATCH v2 1/2] bootstrap: " 'Felix Moessbauer' via isar-users
2026-07-21 15:04 ` [PATCH v2 2/2] dpkg: " 'Felix Moessbauer' via isar-users
2026-07-23 10:16   ` 'MOESSBAUER, Felix' via isar-users [this message]
2026-07-23 13:36     ` Zhihang Wei
2026-07-28 18:24   ` 'Jan Kiszka' via isar-users
2026-07-29  8:07     ` 'MOESSBAUER, Felix' via isar-users
2026-07-28 15:29 ` [PATCH v2 1/2] bootstrap: " Zhihang Wei

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=a7719ebf80e1414a57799974e4934303f68bdba5.camel@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=wzh@ilbers.de \
    /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