[v2,1/2] dpkg: let do_deploy_deb runtime depend on do_deploy_source

Message ID 20260806072428.2409275-2-felix.moessbauer@siemens.com
State Under Review
Headers show
Series ensure source packages are deployed on rebuild with sstate | expand

Commit Message

MOESSBAUER, Felix Aug. 6, 2026, 7:24 a.m. UTC
The isar-apt is an artifact that is deployed by isar and can be consumed
as-is as an apt repository by downstream users. As the isar-apt also
provides the debian source packages, we have to ensure that these are
also deployed when the do_dpkg_build task is provided by the SState
cache. Otherwise the isar-apt is not reproducible across runs with and
without the SState cache.

To fix this, we add a runtime dependency between do_deploy_deb and
do_deploy_source, to ensure all sources of our debs are deployed as
well.

Reported-by: Andreas Ziegler <ziegler.andreas@siemens.com>
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes-recipe/dpkg-source.bbclass | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andreas Ziegler Aug. 6, 2026, 8:19 a.m. UTC | #1
Am 06.08.2026 um 09:24 schrieb Felix Moessbauer:
> The isar-apt is an artifact that is deployed by isar and can be consumed
> as-is as an apt repository by downstream users. As the isar-apt also
> provides the debian source packages, we have to ensure that these are
> also deployed when the do_dpkg_build task is provided by the SState
> cache. Otherwise the isar-apt is not reproducible across runs with and
> without the SState cache.
> 
> To fix this, we add a runtime dependency between do_deploy_deb and
> do_deploy_source, to ensure all sources of our debs are deployed as
> well.
> 
> Reported-by: Andreas Ziegler <ziegler.andreas@siemens.com>
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>   meta/classes-recipe/dpkg-source.bbclass | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/meta/classes-recipe/dpkg-source.bbclass b/meta/classes-recipe/dpkg-source.bbclass
> index b2b45ed3..92d06e1b 100644
> --- a/meta/classes-recipe/dpkg-source.bbclass
> +++ b/meta/classes-recipe/dpkg-source.bbclass
> @@ -49,6 +49,8 @@ do_deploy_source() {
>   addtask deploy_source after do_dpkg_source
>   
>   do_dpkg_build[depends] += "${BPN}:do_deploy_source"
> +# ensure that the source package is deployed into isar-apt
> +do_deploy_deb[rdepends] += "${BPN}:do_deploy_source"
>   
>   SCHROOT_MOUNTS = "${WORKDIR}:/work ${REPO_ISAR_DIR}/${DISTRO}:/isar-apt"
>   

Works like a charm in our pipeline, so:

Tested-by: Andreas Ziegler <ziegler.andreas@siemens.com>

Thanks!

Andreas

Patch

diff --git a/meta/classes-recipe/dpkg-source.bbclass b/meta/classes-recipe/dpkg-source.bbclass
index b2b45ed3..92d06e1b 100644
--- a/meta/classes-recipe/dpkg-source.bbclass
+++ b/meta/classes-recipe/dpkg-source.bbclass
@@ -49,6 +49,8 @@  do_deploy_source() {
 addtask deploy_source after do_dpkg_source
 
 do_dpkg_build[depends] += "${BPN}:do_deploy_source"
+# ensure that the source package is deployed into isar-apt
+do_deploy_deb[rdepends] += "${BPN}:do_deploy_source"
 
 SCHROOT_MOUNTS = "${WORKDIR}:/work ${REPO_ISAR_DIR}/${DISTRO}:/isar-apt"