Skip to contentSkip to conversation

spdx-common: load_spdx_license_data depends on the SPDX_LICENSES content

PATCH Jose Quaresma 1 participant 2 messages Oct 21, 2025 – Oct 22, 2025 2 messages not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi,

Please discard this patch as it is not fully functional. I will send a v2 after testing it a bit more.

Jose

Jose Quaresma via lists.openembedded.org <quaresma.jose= [email protected]> escreveu (terça, 21/10/2025 à(s) 18:00):

Quoted 60 lines

If we have changes on SPDX_LICENSES content we ended up building invalid sstate-cache archives.
The default value for the SPDX_LICENSES is the file meta/files/spdx-licenses.json but this file
don't use the bitbake fetcher and because of this their checksum is not validated.
So we need to add this file to the build dependency chain of the SPDX.

For example, currently we have bump from 3.24.0 to 3.27.0 on master-next for the file
meta/files/spdx-licenses.json. Since the file content is not taken into account, we end
up creating invalid sstate-cache artifacts on the autobuilder on master-next builds.
This created sstate-cache artifacts will also be available to master branch users
that are using the upstream sstate-cache mirror.

If someone is using the public mirror but still following the master branch they will encounter something like the following error which this change aims to resolve.

| ERROR: initramfs-rootfs-image-1.0-r0 do_create_image_sbom_spdx:
http://spdxdocs.org/openembedded-alias/by-doc-hash/57301e8063a8bf25308226271627db2b78675cda9f648c5c6c14a2b9c18f48dc/zlib/UNIHASH/license/3_27_0/Zlib
not found in /work/build/tmp/deploy/spdx/3.0.1/armv8a/by-spdxid-hash/57/57301e8063a8bf25308226271627db2b78675cda9f648c5c6c14a2b9c18f48dc.spdx.json

---
 meta/classes/spdx-common.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/spdx-common.bbclass +0 -0
index ca0416d1c7..69ced76150 100644
@@ -105,3 +105,4 @@ oe.spdx_common.collect_direct_deps[vardepsexclude] +=

"BB_TASKDEPDATA"
oe.spdx_common.collect_direct_deps[vardeps] += "DEPENDS" oe.spdx_common.collect_package_providers[vardepsexclude] +=
"BB_TASKDEPDATA"
oe.spdx_common.get_patched_src[vardepsexclude] += "STAGING_KERNEL_DIR"
+oe.spdx_common.load_spdx_license_data[file-checksums] += "${SPDX_LICENSES}:True"
--
2.51.1.dirty

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#225154):
https://lists.openembedded.org/g/openembedded-core/message/225154
Mute This Topic: https://lists.openembedded.org/mt/115877012/5052612
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Best regards,

José Quaresma
#3 lore raw
In reply to a message not in the archive

Jose Quaresma via lists.openembedded.org <quaresma.jose= [email protected]> escreveu (terça, 21/10/2025 à(s) 18:20):

Quoted 43 lines

Hi,

Please discard this patch as it is not fully functional. I will send a v2 after testing it a bit more.

Jose

Jose Quaresma via lists.openembedded.org <quaresma.jose= [email protected]> escreveu (terça, 21/10/2025 à(s) 18:00):

Quoted 33 lines

If we have changes on SPDX_LICENSES content we ended up building invalid sstate-cache archives.
The default value for the SPDX_LICENSES is the file meta/files/spdx-licenses.json but this file
don't use the bitbake fetcher and because of this their checksum is not validated.
So we need to add this file to the build dependency chain of the SPDX.

For example, currently we have bump from 3.24.0 to 3.27.0 on master-next for the file
meta/files/spdx-licenses.json. Since the file content is not taken into account, we end
up creating invalid sstate-cache artifacts on the autobuilder on master-next builds.
This created sstate-cache artifacts will also be available to master branch users
that are using the upstream sstate-cache mirror.

If someone is using the public mirror but still following the master branch
they will encounter something like the following error which this change aims to resolve.

| ERROR: initramfs-rootfs-image-1.0-r0 do_create_image_sbom_spdx:
http://spdxdocs.org/openembedded-alias/by-doc-hash/57301e8063a8bf25308226271627db2b78675cda9f648c5c6c14a2b9c18f48dc/zlib/UNIHASH/license/3_27_0/Zlib
not found in /work/build/tmp/deploy/spdx/3.0.1/armv8a/by-spdxid-hash/57/57301e8063a8bf25308226271627db2b78675cda9f648c5c6c14a2b9c18f48dc.spdx.json

---
 meta/classes/spdx-common.bbclass | 1 +
 1 file changed, 1 insertion(+)
Quoted 15 lines
Quoted 6 lines
meta/classes/spdx-common.bbclass +0 -0
index ca0416d1c7..69ced76150 100644
@@ -105,3 +105,4 @@ oe.spdx_common.collect_direct_deps[vardepsexclude] +=
Quoted 8 lines

"BB_TASKDEPDATA"
oe.spdx_common.collect_direct_deps[vardeps] += "DEPENDS" oe.spdx_common.collect_package_providers[vardepsexclude] +=
"BB_TASKDEPDATA"
oe.spdx_common.get_patched_src[vardepsexclude] += "STAGING_KERNEL_DIR"
+oe.spdx_common.load_spdx_license_data[file-checksums] += "${SPDX_LICENSES}:True"

Unfortunately this change did not work as I expected and I sent a new V2.

Jose

Quoted 24 lines

--

Quoted 6 lines

2.51.1.dirty

--
Best regards,

José Quaresma

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#225157):
https://lists.openembedded.org/g/openembedded-core/message/225157
Mute This Topic: https://lists.openembedded.org/mt/115877012/5052612
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Best regards,

José Quaresma