Skip to contentSkip to conversation

eSDK installation fix for SPDX 3.0

PATCH In review [email protected] 2 participants 4 messages Apr 29 – Aug 24

lore
Share & tools
lore
#0 lore raw

v5 cover eSDK installation fix for SPDX 3.0

From: Sunil Dora <[email protected]>

Reposting Jayasurya's v4 series, rebased on current master. The bug is still reproducible on clean master.

History:
v1 (Oct 10): single patch in populate_sdk_ext.bbclass
v2 (Oct 29): moved addtask to create-spdx-sdk-3.0.bbclass per Joshua's
review feedback
v3 (Nov 5): moved addtask to create-spdx-image-3.0.bbclass per Joshua's
feedback to avoid addtask in multiple locations
v4 (Dec 15): split into two patches and addressed shortlog length
warning per Randy's review
v5: rebased on current master.

Jayasurya Maganuru (2):
create-spdx-image-3.0: Image SPDX/SBOM tasks are retained for eSDK
installation
populate_sdk_ext: keep SDK_TARGETS so SPDX/SBOM tasks remain in locked
sigs

 meta/classes-recipe/create-spdx-image-3.0.bbclass | 2 +-
 meta/classes-recipe/populate_sdk_ext.bbclass      | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
Signature · 1 line
2.49.0
#1 lore raw

PATCH v5 1/2 create-spdx-image-3.0: Image SPDX/SBOM tasks are retained for eSDK installation

From: Jayasurya Maganuru <[email protected]>

Fixes [YOCTO #15853]

Image SPDX/SBOM tasks were running after do_sdk_depends, causing their signatures to be excluded from locked-sigs.inc. As a result, the eSDK installer attempted to re-run these tasks, leading to unexpected task execution errors.

Run do_create_image_sbom_spdx before do_sdk_depends to ensure all image SPDX/SBOM tasks are completed and captured in the locked signatures.

---
 meta/classes-recipe/create-spdx-image-3.0.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/create-spdx-image-3.0.bbclass +1 -1
index 15a91e90e2..b9e34645f9 100644
@@ -69,7 +69,7 @@ python do_create_image_sbom_spdx() {
     import oe.spdx30_tasks
     oe.spdx30_tasks.create_image_sbom_spdx(d)
 }
-addtask do_create_image_sbom_spdx after do_create_rootfs_spdx do_create_image_spdx before do_build
+addtask do_create_image_sbom_spdx after do_create_rootfs_spdx do_create_image_spdx before do_build do_sdk_depends
 SSTATETASKS += "do_create_image_sbom_spdx"
 SSTATE_SKIP_CREATION:task-create-image-sbom = "1"
 do_create_image_sbom_spdx[sstate-inputdirs] = "${SPDXIMAGEDEPLOYDIR}"
Signature · 1 line
2.49.0
#2 lore raw

PATCH v5 2/2 populate_sdk_ext: keep SDK_TARGETS so SPDX/SBOM tasks remain in locked sigs

In reply to [email protected]

From: Jayasurya Maganuru <[email protected]>

Fixes [YOCTO #15853]

The filtering in populate_sdk_ext.bbclass was removing all image targets from the locked signatures, including the main SDK images (SDK_TARGETS). As a result, their tasks including the image SPDX/SBOM tasks were not added to locked-sigs.inc.

Without these entries, the eSDK lacked the necessary sstate, and the installer attempted to run the missing tasks during installation, leading to unexpected task execution errors.

This patch keeps SDK_TARGETS (and their multilib variants) in the locked signatures so their SPDX/SBOM tasks are included. With those tasks in the sstate cache, the eSDK installs cleanly without needing to re-run anything.

---
 meta/classes-recipe/populate_sdk_ext.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)
meta/classes-recipe/populate_sdk_ext.bbclass +9 -0
index 071cf959e7..d17fc3af64 100644
@@ -461,6 +461,15 @@ def prepare_locked_cache(d, baseoutpath, derivative, conf_initpath):
 
     # Filter the locked signatures file to just the sstate tasks we are interested in
     excluded_targets = get_sdk_install_targets(d, images_only=True)
+    sdk_targets = d.getVar('SDK_TARGETS')
+    ext_sdk_target_set = set(multilib_pkg_extend(d, sdk_targets).split())
+    excluded_set = set(excluded_targets.split())
+
+    # Ensure SDK_TARGETS and their image SPDX/SBOM tasks are included in the locked signatures,
+    # as they are required during eSDK installation.
+    filtered_excluded_set = excluded_set - ext_sdk_target_set
+    excluded_targets = ' '.join(filtered_excluded_set)
+
     sigfile = d.getVar('WORKDIR') + '/locked-sigs.inc'
     lockedsigs_pruned = baseoutpath + '/conf/locked-sigs.inc'
     #nativesdk-only sigfile to merge into locked-sigs.inc
Signature · 1 line
2.49.0
#3 lore raw

Re: [OE-core] [PATCH v5 2/2] populate_sdk_ext: keep SDK_TARGETS so SPDX/SBOM tasks remain in locked sigs

Quoted 40 lines · Sunil Kumar via lists.openembedded.org

From: Jayasurya Maganuru <[email protected]>

Fixes [YOCTO #15853]

The filtering in populate_sdk_ext.bbclass was removing all image targets from the locked signatures, including the main SDK images (SDK_TARGETS). As a result, their tasks including the image SPDX/SBOM tasks were not added to locked-sigs.inc.

Without these entries, the eSDK lacked the necessary sstate, and the installer attempted to run the missing tasks during installation, leading to unexpected task execution errors.

This patch keeps SDK_TARGETS (and their multilib variants) in the locked signatures so their SPDX/SBOM tasks are included. With those tasks in the sstate cache, the eSDK installs cleanly without needing to re-run anything.

---
 meta/classes-recipe/populate_sdk_ext.bbclass | 9 +++++++++

 1 file changed, 9 insertions(+)
meta/classes-recipe/populate_sdk_ext.bbclass +0 -0
index 071cf959e7..d17fc3af64 100644
@@ -461,6 +461,15 @@ def prepare_locked_cache(d, baseoutpath, derivative, conf_initpath):


     # Filter the locked signatures file to just the sstate tasks we are interested in excluded_targets = get_sdk_install_targets(d, images_only=True)
+    sdk_targets = d.getVar('SDK_TARGETS')
+    ext_sdk_target_set = set(multilib_pkg_extend(d, sdk_targets).split()) +    excluded_set = set(excluded_targets.split())

meta/classes-recipe/populate_sdk_ext.bbclass +6 -0
+
+    # Ensure SDK_TARGETS and their image SPDX/SBOM tasks are included in the locked signatures,
+    # as they are required during eSDK installation.
+    filtered_excluded_set = excluded_set - ext_sdk_target_set
+    excluded_targets = ' '.join(filtered_excluded_set)
+
Quoted 3 lines

     sigfile = d.getVar('WORKDIR') + '/locked-sigs.inc' lockedsigs_pruned = baseoutpath + '/conf/locked-sigs.inc' #nativesdk-only sigfile to merge into locked-sigs.inc

I've commented on the bug for this, I wasn't able to reproduce the problem. If someone can explain how to reproduce the bug with master, I'm willing to look at it further.

Having stared at this code a lot, I'm not convinced this patch is right at all, quite the opposite. SDK_TARGETS are explicitly not included in the locked sigs and there isn't a rationale for changing that here. In my own tests, whilst the spdx tasks for the SDK_TARGET do run, they do so with all the right sstate present so it is all working as designed.

This patch is therefore not right and if there is a problem, I'd like to see a way to reproduce it.

Cheers,

Richard