[4/6] sbom: deploy sbom chroot to distro specific file

Message ID 20260720081347.3835974-5-felix.moessbauer@siemens.com
State New
Headers show
Series Rework SBOM generation | expand

Commit Message

Felix Moessbauer July 20, 2026, 8:13 a.m. UTC
When running under multiconfig with targets that do not share the
distribution, the sbom chroot is built multiple times and deployed to
the same file (data race).

As this does not matter much for the SBOM generation itself, this was
not detected. However, when building with sstate cache it can happen
that multiple sbom chroots are deployed roughly at the same time (racy),
breaking the build.

We fix it by making the sbom chroot rootfs file distro and architecture
specific.

Fixes: 812b6c77 ("meta: add SBOM generation with debsbom")
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes/sbom.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/classes/sbom.bbclass b/meta/classes/sbom.bbclass
index 1801afac..29cae780 100644
--- a/meta/classes/sbom.bbclass
+++ b/meta/classes/sbom.bbclass
@@ -23,7 +23,7 @@  SBOM_SPDX_NAMESPACE_PREFIX ?= "https://spdx.org/spdxdocs"
 DEPLOY_DIR_SBOM = "${DEPLOY_DIR_IMAGE}"
 
 SBOM_DIR = "${DEPLOY_DIR}/sbom"
-SBOM_CHROOT = "${SBOM_DIR}/sbom-chroot.tar.zst"
+SBOM_CHROOT = "${SBOM_DIR}/${HOST_DISTRO}-${HOST_ARCH}_${DISTRO}-${DISTRO_ARCH}.tar.zst"
 SBOM_CHROOT_LOCAL = "${WORKDIR}/sbom-chroot"
 
 # adapted from the isar-cip-core image_uuid.bbclass