backport: SPDX 3.0 support to Scarthgap
v2 cover backport: SPDX 3.0 support to Scarthgap
Hello,
This v2 series backports SPDX 3.0 support from the upstream Walnascar branch to Scarthgap (Yocto Project 5.0 LTS), including the corresponding test suite and fixes for integration issues found during testing.
The motivation remains the same as in v1, to bring complete SPDX 3.0 support to the latest LTS release, ensuring that long-term supported builds benefit SBOM generation capabilities. Scarthgap is under maintenance until 2028, and SPDX 3.0 is now an essential part of compliance workflows.
Kamel
Hongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-share
Joshua Watt (7):
classes-global/license: Move functions to library code lib/license: Move package license skip to library
lib: oe: license: Add missing import classes-recipe/image: Add image file manifest
selftest: spdx: Add SPDX 3.0 test cases
lib: oeqa: spdx: Add tests for extra options spdx 3.0: Rework how SPDX aliases are linked
Kamel Bouhara (Schneider Electric) (3):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute in add_download_files
spdx30_tasks: adapt CVE handling to new cve-check API
meta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - .../create-spdx-image-3.0.bbclass | 85 + .../create-spdx-sdk-3.0.bbclass | 74 + meta/classes-recipe/image.bbclass | 58 + meta/classes-recipe/license_image.bbclass | 14 +- meta/classes-recipe/nospdx.bbclass | 13 + meta/classes/create-spdx-3.0.bbclass | 200 + meta/classes/spdx-common.bbclass | 99 + meta/lib/oe/__init__.py | 2 +- meta/lib/oe/license.py | 203 + meta/lib/oe/sbom30.py | 1096 ++++ meta/lib/oe/spdx30.py | 5593 +++++++++++++++++ meta/lib/oe/spdx30_tasks.py | 1343 ++++ meta/lib/oe/spdx_common.py | 244 + meta/lib/oeqa/selftest/cases/spdx.py | 248 +- 16 files changed, 9262 insertions(+), 216 deletions(-) create mode 100644 meta/classes-recipe/create-spdx-image-3.0.bbclass create mode 100644 meta/classes-recipe/create-spdx-sdk-3.0.bbclass create mode 100644 meta/classes-recipe/nospdx.bbclass create mode 100644 meta/classes/create-spdx-3.0.bbclass create mode 100644 meta/classes/spdx-common.bbclass create mode 100644 meta/lib/oe/sbom30.py create mode 100644 meta/lib/oe/spdx30.py create mode 100644 meta/lib/oe/spdx30_tasks.py create mode 100644 meta/lib/oe/spdx_common.py
--
2.43.0
PATCH v2 1/11 backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
From: "Kamel Bouhara (Schneider Electric)" <[email protected]>
Backports the SPDX 3.0 support and fixes from upstream walnascar commit 49f47169953b807d430461ca33f3a2b076119712 into upstream scarthgap.
--- .../create-spdx-image-3.0.bbclass | 85 + .../create-spdx-sdk-3.0.bbclass | 74 + meta/classes-recipe/nospdx.bbclass | 13 + meta/classes/create-spdx-3.0.bbclass | 200 + meta/classes/spdx-common.bbclass | 99 + meta/lib/oe/__init__.py | 2 +- meta/lib/oe/sbom30.py | 1096 ++++ meta/lib/oe/spdx30.py | 5593 +++++++++++++++++ meta/lib/oe/spdx30_tasks.py | 1348 ++++ meta/lib/oe/spdx_common.py | 244 + 10 files changed, 8753 insertions(+), 1 deletion(-) create mode 100644 meta/classes-recipe/create-spdx-image-3.0.bbclass create mode 100644 meta/classes-recipe/create-spdx-sdk-3.0.bbclass create mode 100644 meta/classes-recipe/nospdx.bbclass create mode 100644 meta/classes/create-spdx-3.0.bbclass create mode 100644 meta/classes/spdx-common.bbclass create mode 100644 meta/lib/oe/sbom30.py create mode 100644 meta/lib/oe/spdx30.py create mode 100644 meta/lib/oe/spdx30_tasks.py create mode 100644 meta/lib/oe/spdx_common.py
meta/classes-recipe/create-spdx-image-3.0.bbclass new file +85 -0
@@ -0,0 +1,85 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX image tasks + +SPDX_ROOTFS_PACKAGES = "${SPDXDIR}/rootfs-packages.json" +SPDXIMAGEDEPLOYDIR = "${SPDXDIR}/image-deploy" +SPDXROOTFSDEPLOY = "${SPDXDIR}/rootfs-deploy" + +python spdx_collect_rootfs_packages() { + import json + from pathlib import Path + from oe.rootfs import image_list_installed_packages + + root_packages_file = Path(d.getVar("SPDX_ROOTFS_PACKAGES")) + + packages = image_list_installed_packages(d) + if not packages: + packages = {} + + root_packages_file.parent.mkdir(parents=True, exist_ok=True) + with root_packages_file.open("w") as f: + json.dump(packages, f) +} +ROOTFS_POSTUNINSTALL_COMMAND =+ "spdx_collect_rootfs_packages" + +python do_create_rootfs_spdx() { + import oe.spdx30_tasks + oe.spdx30_tasks.create_rootfs_spdx(d) +} +addtask do_create_rootfs_spdx after do_rootfs before do_image +SSTATETASKS += "do_create_rootfs_spdx" +do_create_rootfs_spdx[sstate-inputdirs] = "${SPDXROOTFSDEPLOY}" +do_create_rootfs_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}" +do_create_rootfs_spdx[recrdeptask] += "do_create_spdx do_create_package_spdx" +do_create_rootfs_spdx[cleandirs] += "${SPDXROOTFSDEPLOY}" +do_create_rootfs_spdx[file-checksums] += "${SPDX3_LIB_DEP_FILES}" + +python do_create_rootfs_spdx_setscene() { + sstate_setscene(d) +} +addtask do_create_rootfs_spdx_setscene + +python do_create_image_spdx() { + import oe.spdx30_tasks + oe.spdx30_tasks.create_image_spdx(d) +} +addtask do_create_image_spdx after do_image_complete do_create_rootfs_spdx before do_build +SSTATETASKS += "do_create_image_spdx" +SSTATE_SKIP_CREATION:task-create-image-spdx = "1" +do_create_image_spdx[sstate-inputdirs] = "${SPDXIMAGEWORK}" +do_create_image_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}" +do_create_image_spdx[cleandirs] = "${SPDXIMAGEWORK}" +do_create_image_spdx[dirs] = "${SPDXIMAGEWORK}" +do_create_image_spdx[file-checksums] += "${SPDX3_LIB_DEP_FILES}" +do_create_image_spdx[vardeps] += "\ + SPDX_IMAGE_PURPOSE \ + " + +python do_create_image_spdx_setscene() { + sstate_setscene(d) +} +addtask do_create_image_spdx_setscene + + +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 +SSTATETASKS += "do_create_image_sbom_spdx" +SSTATE_SKIP_CREATION:task-create-image-sbom = "1" +do_create_image_sbom_spdx[sstate-inputdirs] = "${SPDXIMAGEDEPLOYDIR}" +do_create_image_sbom_spdx[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" +do_create_image_sbom_spdx[stamp-extra-info] = "${MACHINE_ARCH}" +do_create_image_sbom_spdx[cleandirs] = "${SPDXIMAGEDEPLOYDIR}" +do_create_image_sbom_spdx[recrdeptask] += "do_create_spdx do_create_package_spdx" +do_create_image_sbom_spdx[file-checksums] += "${SPDX3_LIB_DEP_FILES}" + +python do_create_image_sbom_spdx_setscene() { + sstate_setscene(d) +} +addtask do_create_image_sbom_spdx_setscene
meta/classes-recipe/create-spdx-sdk-3.0.bbclass new file +74 -0
74 lines not on this page · raw message
meta/classes-recipe/nospdx.bbclass new file +13 -0
@@ -0,0 +1,13 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +deltask do_collect_spdx_deps +deltask do_create_spdx +deltask do_create_spdx_runtime +deltask do_create_package_spdx +deltask do_create_rootfs_spdx +deltask do_create_image_spdx +deltask do_create_image_sbom
meta/classes/create-spdx-3.0.bbclass new file +200 -0
200 lines not on this page · raw message
meta/classes/spdx-common.bbclass new file +99 -0
99 lines not on this page · raw message
meta/lib/oe/__init__.py +1 -1
@@ -9,4 +9,4 @@ __path__ = extend_path(__path__, __name__) BBIMPORTS = ["data", "path", "utils", "types", "package", "packagedata", \ "packagegroup", "sstatesig", "lsb", "cachedpath", "license", \ - "qa", "reproducible", "rust", "buildcfg", "go"] + "qa", "reproducible", "rust", "buildcfg", "go", "spdx30_tasks", "spdx_common"]
meta/lib/oe/sbom30.py new file +1096 -0
1,096 lines not on this page · raw message
meta/lib/oe/spdx30.py new file +5593 -0
1,428 lines not on this page · raw message
meta/lib/oe/spdx30_tasks.py new file +1348 -0
1,348 lines not on this page · raw message
meta/lib/oe/spdx_common.py new file +244 -0
244 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.43.0
Part of the diff is not shown here. View the raw message.
PATCH v2 2/11 spdx30_tasks: fix FetchData attribute in add_download_files
In reply to Kamel BouharaFrom: "Kamel Bouhara (Schneider Electric)" <[email protected]>
The add_download_files() function incorrectly accessed fd.name, which does not exist on FetchData objects.
Change to use fd.names[0] to correctly retrieve the first filename.
This fixes AttributeError during SPDX document generation.
--- meta/lib/oe/spdx30_tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oe/spdx30_tasks.py +1 -1
@@ -405,7 +405,7 @@ def add_download_files(d, objset): name=file_name, software_primaryPurpose=primary_purpose, software_downloadLocation=oe.spdx_common.fetch_data_to_uri( - fd, fd.name + fd, fd.names[0] ), ) )
Signature · 1 line
2.43.0
PATCH v2 3/11 classes-global/license: Move functions to library code
In reply to Kamel BouharaFrom: Joshua Watt <[email protected]>
Moves several of the functions in license.bbclass to be library code
New function dependencies were manually verified using bitbake-dumpsigs to ensure that bitbake identified the same dependencies even though they are now in library code (although the new function names mean that the task hashes still change)
--- meta/classes-global/base.bbclass | 10 +- meta/classes-global/license.bbclass | 165 ---------------------- meta/classes-recipe/license_image.bbclass | 14 +- meta/lib/oe/license.py | 163 +++++++++++++++++++++ 4 files changed, 175 insertions(+), 177 deletions(-)
meta/classes-global/base.bbclass +5 -5
@@ -520,8 +520,8 @@ python () { bb.fatal('This recipe does not have the LICENSE field set (%s)' % pn) if bb.data.inherits_class('license', d): - check_license_format(d) - unmatched_license_flags = check_license_flags(d) + oe.license.check_license_format(d) + unmatched_license_flags = oe.license.check_license_flags(d) if unmatched_license_flags: for unmatched in unmatched_license_flags: message = "Has a restricted license '%s' which is not listed in your LICENSE_FLAGS_ACCEPTED." % unmatched
@@ -575,7 +575,7 @@ python () { check_license = False if check_license and bad_licenses: - bad_licenses = expand_wildcard_licenses(d, bad_licenses) + bad_licenses = oe.license.expand_wildcard_licenses(d, bad_licenses) exceptions = (d.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS") or "").split()
@@ -591,7 +591,7 @@ python () { for pkg in pkgs: remaining_bad_licenses = oe.license.apply_pkg_license_exception(pkg, bad_licenses, exceptions) - incompatible_lic = incompatible_license(d, remaining_bad_licenses, pkg) + incompatible_lic = oe.license.incompatible_license(d, remaining_bad_licenses, pkg) if incompatible_lic: skipped_pkgs[pkg] = incompatible_lic else:
@@ -604,7 +604,7 @@ python () { for pkg in unskipped_pkgs: bb.debug(1, "Including the package %s" % pkg) else: - incompatible_lic = incompatible_license(d, bad_licenses) + incompatible_lic = oe.license.incompatible_license(d, bad_licenses) for pkg in skipped_pkgs: incompatible_lic += skipped_pkgs[pkg] incompatible_lic = sorted(list(set(incompatible_lic)))
meta/classes-global/license.bbclass +0 -165
171 lines not on this page · raw message
meta/classes-recipe/license_image.bbclass +7 -7
@@ -58,7 +58,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): import stat bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE") or "").split() - bad_licenses = expand_wildcard_licenses(d, bad_licenses) + bad_licenses = oe.license.expand_wildcard_licenses(d, bad_licenses) pkgarchs = d.getVar("SSTATE_ARCHS").split() pkgarchs.reverse()
@@ -66,17 +66,17 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): with open(license_manifest, "w") as license_file: for pkg in sorted(pkg_dic): remaining_bad_licenses = oe.license.apply_pkg_license_exception(pkg, bad_licenses, exceptions) - incompatible_licenses = incompatible_pkg_license(d, remaining_bad_licenses, pkg_dic[pkg]["LICENSE"]) + incompatible_licenses = oe.license.incompatible_pkg_license(d, remaining_bad_licenses, pkg_dic[pkg]["LICENSE"]) if incompatible_licenses: bb.fatal("Package %s cannot be installed into the image because it has incompatible license(s): %s" %(pkg, ' '.join(incompatible_licenses))) else: - incompatible_licenses = incompatible_pkg_license(d, bad_licenses, pkg_dic[pkg]["LICENSE"]) + incompatible_licenses = oe.license.incompatible_pkg_license(d, bad_licenses, pkg_dic[pkg]["LICENSE"]) if incompatible_licenses: oe.qa.handle_error('license-incompatible', "Including %s with incompatible license(s) %s into the image, because it has been allowed by exception list." %(pkg, ' '.join(incompatible_licenses)), d) try: (pkg_dic[pkg]["LICENSE"], pkg_dic[pkg]["LICENSES"]) = \ oe.license.manifest_licenses(pkg_dic[pkg]["LICENSE"], - remaining_bad_licenses, canonical_license, d) + remaining_bad_licenses, oe.license.canonical_license, d) except oe.license.LicenseError as exc: bb.fatal('%s: %s' % (d.getVar('P'), exc))
@@ -144,7 +144,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): if not os.path.exists(pkg_license_dir ): bb.fatal("Couldn't find license information for dependency %s" % pkg) - pkg_manifest_licenses = [canonical_license(d, lic) \ + pkg_manifest_licenses = [oe.license.canonical_license(d, lic) \ for lic in pkg_dic[pkg]["LICENSES"]] licenses = os.listdir(pkg_license_dir)
@@ -153,7 +153,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) if re.match(r"^generic_.*$", lic): - generic_lic = canonical_license(d, + generic_lic = oe.license.canonical_license(d, re.search(r"^generic_(.*)$", lic).group(1)) # Do not copy generic license into package if isn't
@@ -176,7 +176,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): if not os.path.exists(pkg_rootfs_license): os.symlink(os.path.join('..', generic_lic_file), pkg_rootfs_license) else: - if (oe.license.license_ok(canonical_license(d, + if (oe.license.license_ok(oe.license.canonical_license(d, lic), bad_licenses) == False or os.path.exists(pkg_rootfs_license)): continue
meta/lib/oe/license.py +163 -0
166 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v2 4/11 lib/license: Move package license skip to library
In reply to Kamel BouharaFrom: Joshua Watt <[email protected]>
Moves the code that skips packages with incompatible licenses to the library code so that it can be called in other locations
--- meta/classes-global/base.bbclass | 35 ++++------------------------ meta/lib/oe/license.py | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 31 deletions(-)
meta/classes-global/base.bbclass +4 -31
@@ -565,37 +565,10 @@ python () { bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split() - check_license = False if pn.startswith("nativesdk-") else True - for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}", - "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}", - "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]: - if pn.endswith(d.expand(t)): - check_license = False - if pn.startswith("gcc-source-"): - check_license = False - - if check_license and bad_licenses: - bad_licenses = oe.license.expand_wildcard_licenses(d, bad_licenses) - - exceptions = (d.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS") or "").split() - - for lic_exception in exceptions: - if ":" in lic_exception: - lic_exception = lic_exception.split(":")[1] - if lic_exception in oe.license.obsolete_license_list(): - bb.fatal("Obsolete license %s used in INCOMPATIBLE_LICENSE_EXCEPTIONS" % lic_exception) - - pkgs = d.getVar('PACKAGES').split() - skipped_pkgs = {} - unskipped_pkgs = [] - for pkg in pkgs: - remaining_bad_licenses = oe.license.apply_pkg_license_exception(pkg, bad_licenses, exceptions) - - incompatible_lic = oe.license.incompatible_license(d, remaining_bad_licenses, pkg) - if incompatible_lic: - skipped_pkgs[pkg] = incompatible_lic - else: - unskipped_pkgs.append(pkg) + pkgs = d.getVar('PACKAGES').split() + if pkgs: + skipped_pkgs = oe.license.skip_incompatible_package_licenses(d, pkgs) + unskipped_pkgs = [p for p in pkgs if p not in skipped_pkgs] if unskipped_pkgs: for pkg in skipped_pkgs:
meta/lib/oe/license.py +39 -0
@@ -422,3 +422,42 @@ def check_license_format(d): '%s: LICENSE value "%s" has an invalid separator "%s" that is not ' \ 'in the valid list of separators (%s)' % (pn, licenses, element, license_operator_chars), d) + +def skip_incompatible_package_licenses(d, pkgs): + if not pkgs: + return {} + + pn = d.getVar("PN") + + check_license = False if pn.startswith("nativesdk-") else True + for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}", + "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}", + "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]: + if pn.endswith(d.expand(t)): + check_license = False + if pn.startswith("gcc-source-"): + check_license = False + + bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split() + if not check_license or not bad_licenses: + return {} + + bad_licenses = expand_wildcard_licenses(d, bad_licenses) + + exceptions = (d.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS") or "").split() + + for lic_exception in exceptions: + if ":" in lic_exception: + lic_exception = lic_exception.split(":")[1] + if lic_exception in obsolete_license_list(): + bb.fatal("Obsolete license %s used in INCOMPATIBLE_LICENSE_EXCEPTIONS" % lic_exception) + + skipped_pkgs = {} + for pkg in pkgs: + remaining_bad_licenses = apply_pkg_license_exception(pkg, bad_licenses, exceptions) + + incompatible_lic = incompatible_license(d, remaining_bad_licenses, pkg) + if incompatible_lic: + skipped_pkgs[pkg] = incompatible_lic + + return skipped_pkgs
Signature · 1 line
2.43.0
PATCH v2 5/11 lib: oe: license: Add missing import
In reply to Kamel BouharaFrom: Joshua Watt <[email protected]>
The code in this file uses oe.qa, but it was not imported resulting an an exception when a license error was detected
--- meta/lib/oe/license.py | 1 + 1 file changed, 1 insertion(+)
meta/lib/oe/license.py +1 -0
@@ -7,6 +7,7 @@ import ast import re +import oe.qa from fnmatch import fnmatchcase as fnmatch def license_ok(license, dont_want_licenses):
Signature · 1 line
2.43.0
PATCH v2 6/11 classes-recipe/image: Add image file manifest
In reply to Kamel BouharaFrom: Joshua Watt <[email protected]>
Downstream tasks may want to know what image files were written by the do_image family of tasks (e.g. SPDX) so have each task write out a manifest file that describes the files it produced, then aggregate them in do_image_complete
--- meta/classes-recipe/image.bbclass | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+)
meta/classes-recipe/image.bbclass +58 -0
@@ -88,6 +88,11 @@ PACKAGE_INSTALL_ATTEMPTONLY ?= "${FEATURE_INSTALL_OPTIONAL}" IMGDEPLOYDIR = "${WORKDIR}/deploy-${PN}-image-complete" +IMGMANIFESTDIR = "${WORKDIR}/image-task-manifest" + +IMAGE_OUTPUT_MANIFEST_DIR = "${WORKDIR}/deploy-image-output-manifest" +IMAGE_OUTPUT_MANIFEST = "${IMAGE_OUTPUT_MANIFEST_DIR}/manifest.json" + # Images are generally built explicitly, do not need to be part of world. EXCLUDE_FROM_WORLD = "1"
@@ -277,14 +282,28 @@ fakeroot python do_image () { execute_pre_post_process(d, pre_process_cmds) } do_image[dirs] = "${TOPDIR}" +do_image[cleandirs] += "${IMGMANIFESTDIR}" addtask do_image after do_rootfs fakeroot python do_image_complete () { from oe.utils import execute_pre_post_process + from pathlib import Path + import json post_process_cmds = d.getVar("IMAGE_POSTPROCESS_COMMAND") execute_pre_post_process(d, post_process_cmds) + + image_manifest_dir = Path(d.getVar('IMGMANIFESTDIR')) + + data = [] + + for manifest_path in image_manifest_dir.glob("*.json"): + with manifest_path.open("r") as f: + data.extend(json.load(f)) + + with open(d.getVar("IMAGE_OUTPUT_MANIFEST"), "w") as f: + json.dump(data, f) } do_image_complete[dirs] = "${TOPDIR}" SSTATETASKS += "do_image_complete"
@@ -292,6 +311,8 @@ SSTATE_SKIP_CREATION:task-image-complete = '1' do_image_complete[sstate-inputdirs] = "${IMGDEPLOYDIR}" do_image_complete[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" do_image_complete[stamp-extra-info] = "${MACHINE_ARCH}" +do_image_complete[sstate-plaindirs] += "${IMAGE_OUTPUT_MANIFEST_DIR}" +do_image_complete[dirs] += "${IMAGE_OUTPUT_MANIFEST_DIR}" addtask do_image_complete after do_image before do_build python do_image_complete_setscene () { sstate_setscene(d)
@@ -501,12 +522,14 @@ python () { d.setVar(task, '\n'.join(cmds)) d.setVarFlag(task, 'func', '1') d.setVarFlag(task, 'fakeroot', '1') + d.setVarFlag(task, 'imagetype', t) d.appendVarFlag(task, 'prefuncs', ' ' + debug + ' set_image_size') d.prependVarFlag(task, 'postfuncs', 'create_symlinks ') d.appendVarFlag(task, 'subimages', ' ' + ' '.join(subimages)) d.appendVarFlag(task, 'vardeps', ' ' + ' '.join(vardeps)) d.appendVarFlag(task, 'vardepsexclude', ' DATETIME DATE ' + ' '.join(vardepsexclude)) + d.appendVarFlag(task, 'postfuncs', ' write_image_output_manifest') bb.debug(2, "Adding task %s before %s, after %s" % (task, 'do_image_complete', after)) bb.build.addtask(task, 'do_image_complete', after, d)
@@ -604,6 +627,41 @@ python create_symlinks() { bb.note("Skipping symlink, source does not exist: %s -> %s" % (dst, src)) } +python write_image_output_manifest() { + import json + from pathlib import Path + + taskname = d.getVar("BB_CURRENTTASK") + image_deploy_dir = Path(d.getVar('IMGDEPLOYDIR')) + image_manifest_dir = Path(d.getVar('IMGMANIFESTDIR')) + manifest_path = image_manifest_dir / ("do_" + d.getVar("BB_CURRENTTASK") + ".json") + + image_name = d.getVar("IMAGE_NAME") + image_basename = d.getVar("IMAGE_BASENAME") + machine = d.getVar("MACHINE") + + subimages = (d.getVarFlag("do_" + taskname, 'subimages', False) or "").split() + imagetype = d.getVarFlag("do_" + taskname, 'imagetype', False) + + data = { + "taskname": taskname, + "imagetype": imagetype, + "images": [] + } + + for type in subimages: + image_filename = image_name + "." + type + image_path = image_deploy_dir / image_filename + if not image_path.exists(): + continue + data["images"].append({ + "filename": image_filename, + }) + + with manifest_path.open("w") as f: + json.dump([data], f) +} + MULTILIBRE_ALLOW_REP += "${base_bindir} ${base_sbindir} ${bindir} ${sbindir} ${libexecdir} ${sysconfdir} ${nonarch_base_libdir}/udev /lib/modules/[^/]*/modules.*" MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py" MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib"
Signature · 1 line
2.43.0
PATCH v2 7/11 selftest: spdx: Add SPDX 3.0 test cases
In reply to Kamel BouharaFrom: Joshua Watt <[email protected]>
Adds test cases for SPDX 3.0. Reworks the SPDX 2.2 test setup so it can also be run even if the default is SPDX 3.0
--- meta/lib/oeqa/selftest/cases/spdx.py | 133 +++++++++++++++++++++++++-- 1 file changed, 124 insertions(+), 9 deletions(-)
meta/lib/oeqa/selftest/cases/spdx.py +124 -9
@@ -6,21 +6,26 @@ import json import os +import textwrap +from pathlib import Path from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import bitbake, get_bb_var, runCmd +from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runCmd -class SPDXCheck(OESelftestTestCase): +class SPDX22Check(OESelftestTestCase): @classmethod def setUpClass(cls): - super(SPDXCheck, cls).setUpClass() + super().setUpClass() bitbake("python3-spdx-tools-native") bitbake("-c addto_recipe_sysroot python3-spdx-tools-native") def check_recipe_spdx(self, high_level_dir, spdx_file, target_name): - config = """ -INHERIT += "create-spdx" -""" + config = textwrap.dedent( + """\ + INHERIT:remove = "create-spdx" + INHERIT += "create-spdx-2.2" + """ + ) self.write_config(config) deploy_dir = get_bb_var("DEPLOY_DIR")
@@ -28,7 +33,9 @@ INHERIT += "create-spdx" # qemux86-64 creates the directory qemux86_64 machine_dir = machine_var.replace("-", "_") - full_file_path = os.path.join(deploy_dir, "spdx", machine_dir, high_level_dir, spdx_file) + full_file_path = os.path.join( + deploy_dir, "spdx", spdx_version, machine_dir, high_level_dir, spdx_file + ) try: os.remove(full_file_path)
@@ -43,8 +50,13 @@ INHERIT += "create-spdx" self.assertNotEqual(report, None) self.assertNotEqual(report["SPDXID"], None) - python = os.path.join(get_bb_var('STAGING_BINDIR', 'python3-spdx-tools-native'), 'nativepython3') - validator = os.path.join(get_bb_var('STAGING_BINDIR', 'python3-spdx-tools-native'), 'pyspdxtools') + python = os.path.join( + get_bb_var("STAGING_BINDIR", "python3-spdx-tools-native"), + "nativepython3", + ) + validator = os.path.join( + get_bb_var("STAGING_BINDIR", "python3-spdx-tools-native"), "pyspdxtools" + ) result = runCmd("{} {} -i {}".format(python, validator, filename)) self.assertExists(full_file_path)
@@ -52,3 +64,106 @@ INHERIT += "create-spdx" def test_spdx_base_files(self): self.check_recipe_spdx("packages", "base-files.spdx.json", "base-files") + + +class SPDX3CheckBase(object): + """ + Base class for checking SPDX 3 based tests + """ + + def check_spdx_file(self, filename): + import oe.spdx30 + + self.assertExists(filename) + + # Read the file + objset = oe.spdx30.SHACLObjectSet() + with open(filename, "r") as f: + d = oe.spdx30.JSONLDDeserializer() + d.read(f, objset) + + return objset + + def check_recipe_spdx(self, target_name, spdx_path, *, task=None, extraconf=""): + config = textwrap.dedent( + f"""\ + INHERIT:remove = "create-spdx" + INHERIT += "{self.SPDX_CLASS}" + {extraconf} + """ + ) + self.write_config(config) + + if task: + bitbake(f"-c {task} {target_name}") + else: + bitbake(target_name) + + filename = spdx_path.format( + **get_bb_vars( + [ + "DEPLOY_DIR_IMAGE", + "DEPLOY_DIR_SPDX", + "MACHINE", + "MACHINE_ARCH", + "SDKMACHINE", + "SDK_DEPLOY", + "SPDX_VERSION", + "TOOLCHAIN_OUTPUTNAME", + ], + target_name, + ) + ) + + return self.check_spdx_file(filename) + + def check_objset_missing_ids(self, objset): + if objset.missing_ids: + self.assertTrue( + False, + "The following SPDXIDs are unresolved:\n " + + "\n ".join(objset.missing_ids), + ) + + +class SPDX30Check(SPDX3CheckBase, OESelftestTestCase): + SPDX_CLASS = "create-spdx-3.0" + + def test_base_files(self): + self.check_recipe_spdx( + "base-files", + "{DEPLOY_DIR_SPDX}/{MACHINE_ARCH}/packages/base-files.spdx.json", + ) + + def test_core_image_minimal(self): + objset = self.check_recipe_spdx( + "core-image-minimal", + "{DEPLOY_DIR_IMAGE}/core-image-minimal-{MACHINE}.rootfs.spdx.json", + ) + + # Document should be fully linked + self.check_objset_missing_ids(objset) + + def test_core_image_minimal_sdk(self): + objset = self.check_recipe_spdx( + "core-image-minimal", + "{SDK_DEPLOY}/{TOOLCHAIN_OUTPUTNAME}.spdx.json", + task="populate_sdk", + ) + + # Document should be fully linked + self.check_objset_missing_ids(objset) + + def test_baremetal_helloworld(self): + objset = self.check_recipe_spdx( + "baremetal-helloworld", + "{DEPLOY_DIR_IMAGE}/baremetal-helloworld-image-{MACHINE}.spdx.json", + extraconf=textwrap.dedent( + """\ + TCLIBC = "baremetal" + """ + ), + ) + + # Document should be fully linked + self.check_objset_missing_ids(objset)
Signature · 1 line
2.43.0
PATCH v2 8/11 oeqa/selftest: Add SPDX 3.0 include source case for work-share
In reply to Kamel BouharaFrom: Hongxu Jia <[email protected]>
Build gcc and check gcc-14.2.0/README in objset is available
$ oe-selftest -r spdx.SPDX30Check.test_gcc_include_source ... 2024-10-26 01:24:57,063 - oe-selftest - INFO - test_gcc_include_source (spdx.SPDX30Check.test_gcc_include_source) 2024-10-26 01:28:24,204 - oe-selftest - INFO - The spdxId of gcc-14.2.0/README in gcc.spdx.json is http://spdx.org/spdxdocs/gcc-f2eaeb0d-b54b-53ba-899a-8c36c21139bf/88d5068ffd41e5ea6b4e0dd390b23bf499bb2b6674a41e09eaf2a887eced16c8/sourcefile/42 2024-10-26 01:28:26,369 - oe-selftest - INFO - ... ok 2024-10-26 01:28:33,315 - oe-selftest - INFO - ---------------------------------------------------------------------- 2024-10-26 01:28:33,316 - oe-selftest - INFO - Ran 1 test in 216.457s 2024-10-26 01:28:33,316 - oe-selftest - INFO - OK 2024-10-26 01:28:45,254 - oe-selftest - INFO - RESULTS: 2024-10-26 01:28:45,254 - oe-selftest - INFO - RESULTS - spdx.SPDX30Check.test_gcc_include_source: PASSED (209.31s) 2024-10-26 01:28:45,260 - oe-selftest - INFO - SUMMARY: 2024-10-26 01:28:45,260 - oe-selftest - INFO - oe-selftest () - Ran 1 test in 216.457s 2024-10-26 01:28:45,260 - oe-selftest - INFO - oe-selftest - OK - All required tests passed (successes=1, skipped=0, failures=0, errors=0)
--- meta/lib/oeqa/selftest/cases/spdx.py | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
meta/lib/oeqa/selftest/cases/spdx.py +29 -0
@@ -109,6 +109,7 @@ class SPDX3CheckBase(object): "SDKMACHINE", "SDK_DEPLOY", "SPDX_VERSION", + "SSTATE_PKGARCH", "TOOLCHAIN_OUTPUTNAME", ], target_name,
@@ -135,6 +136,34 @@ class SPDX30Check(SPDX3CheckBase, OESelftestTestCase): "{DEPLOY_DIR_SPDX}/{MACHINE_ARCH}/packages/base-files.spdx.json", ) + + def test_gcc_include_source(self): + import oe.spdx30 + + objset = self.check_recipe_spdx( + "gcc", + "{DEPLOY_DIR_SPDX}/{SSTATE_PKGARCH}/recipes/gcc.spdx.json", + extraconf=textwrap.dedent( + """\ + SPDX_INCLUDE_SOURCES = "1" + """ + ), + ) + + gcc_pv = get_bb_var("PV", "gcc") + filename = f'gcc-{gcc_pv}/README' + found = False + for software_file in objset.foreach_type(oe.spdx30.software_File): + if software_file.name == filename: + found = True + self.logger.info(f"The spdxId of {filename} in gcc.spdx.json is {software_file.spdxId}") + break + + self.assertTrue( + found, + f"Not found source file {filename} in gcc.spdx.json\n" + ) + def test_core_image_minimal(self): objset = self.check_recipe_spdx( "core-image-minimal",
Signature · 1 line
2.43.0
PATCH v2 9/11 lib: oeqa: spdx: Add tests for extra options
In reply to Kamel BouharaFrom: Joshua Watt <[email protected]>
Adds a test for several of the extra options provided by the SPDX classes. In particular, these are the options that can produce non-reproducible results, so are not enabled by default in OE core. This test takes care to configure the build so that the tests do run in a reproducible manner so that pre-built test objects can be pulled from sstate
--- meta/lib/oeqa/selftest/cases/spdx.py | 118 +++++++++++++++++++++++---- 1 file changed, 104 insertions(+), 14 deletions(-)
meta/lib/oeqa/selftest/cases/spdx.py +104 -14
@@ -7,9 +7,11 @@ import json import os import textwrap +import hashlib from pathlib import Path from oeqa.selftest.case import OESelftestTestCase from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runCmd +import oe.spdx30 class SPDX22Check(OESelftestTestCase):
@@ -72,8 +74,6 @@ class SPDX3CheckBase(object): """ def check_spdx_file(self, filename): - import oe.spdx30 - self.assertExists(filename) # Read the file
@@ -85,13 +85,16 @@ class SPDX3CheckBase(object): return objset def check_recipe_spdx(self, target_name, spdx_path, *, task=None, extraconf=""): - config = textwrap.dedent( - f"""\ - INHERIT:remove = "create-spdx" - INHERIT += "{self.SPDX_CLASS}" - {extraconf} - """ + config = ( + textwrap.dedent( + f"""\ + INHERIT:remove = "create-spdx" + INHERIT += "{self.SPDX_CLASS}" + """ + ) + + textwrap.dedent(extraconf) ) + self.write_config(config) if task:
@@ -119,11 +122,17 @@ class SPDX3CheckBase(object): return self.check_spdx_file(filename) def check_objset_missing_ids(self, objset): - if objset.missing_ids: + for o in objset.foreach_type(oe.spdx30.SpdxDocument): + doc = o + break + else: + self.assertTrue(False, "Unable to find SpdxDocument") + + missing_ids = objset.missing_ids - set(i.externalSpdxId for i in doc.import_) + if missing_ids: self.assertTrue( False, - "The following SPDXIDs are unresolved:\n " - + "\n ".join(objset.missing_ids), + "The following SPDXIDs are unresolved:\n " + "\n ".join(missing_ids), )
@@ -187,12 +196,93 @@ class SPDX30Check(SPDX3CheckBase, OESelftestTestCase): objset = self.check_recipe_spdx( "baremetal-helloworld", "{DEPLOY_DIR_IMAGE}/baremetal-helloworld-image-{MACHINE}.spdx.json", - extraconf=textwrap.dedent( - """\ + extraconf="""\ TCLIBC = "baremetal" + """, + ) + + # Document should be fully linked + self.check_objset_missing_ids(objset) + + def test_extra_opts(self): + HOST_SPDXID = "http://foo.bar/spdx/bar2" + + EXTRACONF = textwrap.dedent( + f"""\ + SPDX_INVOKED_BY_name = "CI Tool" + SPDX_INVOKED_BY_type = "software" + + SPDX_ON_BEHALF_OF_name = "John Doe" + SPDX_ON_BEHALF_OF_type = "person" + SPDX_ON_BEHALF_OF_id_email = "[email protected]" + + SPDX_PACKAGE_SUPPLIER_name = "ACME Embedded Widgets" + SPDX_PACKAGE_SUPPLIER_type = "organization" + + SPDX_AUTHORS += "authorA" + SPDX_AUTHORS_authorA_ref = "SPDX_ON_BEHALF_OF" + + SPDX_BUILD_HOST = "host" + + SPDX_IMPORTS += "host" + SPDX_IMPORTS_host_spdxid = "{HOST_SPDXID}" + + SPDX_INCLUDE_BUILD_VARIABLES = "1" + SPDX_INCLUDE_BITBAKE_PARENT_BUILD = "1" + SPDX_INCLUDE_TIMESTAMPS = "1" + + SPDX_PRETTY = "1" + """ + ) + extraconf_hash = hashlib.sha1(EXTRACONF.encode("utf-8")).hexdigest() + + objset = self.check_recipe_spdx( + "core-image-minimal", + "{DEPLOY_DIR_IMAGE}/core-image-minimal-{MACHINE}.rootfs.spdx.json", + # Many SPDX variables do not trigger a rebuild, since they are + # intended to record information at the time of the build. As such, + # the extra configuration alone may not trigger a rebuild, and even + # if it does, the task hash won't necessarily be unique. In order + # to make sure rebuilds happen, but still allow these test objects + # to be pulled from sstate (e.g. remain reproducible), change the + # namespace prefix to include the hash of the extra configuration + extraconf=textwrap.dedent( + f"""\ + SPDX_NAMESPACE_PREFIX = "http://spdx.org/spdxdocs/{extraconf_hash}" """ - ), + ) + + EXTRACONF, ) # Document should be fully linked self.check_objset_missing_ids(objset) + + for o in objset.foreach_type(oe.spdx30.SoftwareAgent): + if o.name == "CI Tool": + break + else: + self.assertTrue(False, "Unable to find software tool") + + for o in objset.foreach_type(oe.spdx30.Person): + if o.name == "John Doe": + break + else: + self.assertTrue(False, "Unable to find person") + + for o in objset.foreach_type(oe.spdx30.Organization): + if o.name == "ACME Embedded Widgets": + break + else: + self.assertTrue(False, "Unable to find organization") + + for o in objset.foreach_type(oe.spdx30.SpdxDocument): + doc = o + break + else: + self.assertTrue(False, "Unable to find SpdxDocument") + + for i in doc.import_: + if i.externalSpdxId == HOST_SPDXID: + break + else: + self.assertTrue(False, "Unable to find imported Host SpdxID")
Signature · 1 line
2.43.0
PATCH v2 10/11 spdx 3.0: Rework how SPDX aliases are linked
In reply to Kamel BouharaFrom: Joshua Watt <[email protected]>
The SPDX code needs to be able to look up an Element by its SPDX ID, locating the file that (should) contain the SPDX ID and opening it for parsing. Previously, the code would do this be hashing each Element SPDX ID and Alias, and the creating a symbolic link to the file that contains the element with a name of the hash.
This worked well as it was possible to look up any arbitrary SPDX ID or alias by simply hashing it and following the symbolic link to get the file. However, the down side of this approach is that it creates a lot of symbolic links, since it will make one or two per Element in the document. This can be a problem when using SPDX_INCLUDE_SOURCES, for example.
This change reworks this strategy so that the only Element that gets a symbolic link based on the hash is the singular SpdxDocument that is create for each file. All other Elements are assigned an alias with a special prefix that encodes the hash of SpdxDocument alias. Thus, when attempting to look up an arbitrary alias, the code sees the special prefix, extract the hash, opens the file based on the symlink with that hash name, then finds the matching Element in the file. This drastically reduces the number of symbolic links by making only one per file.
This also means that the custom link extension can be removed since it is now superfluous.
--- meta/lib/oeqa/selftest/cases/spdx.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-)
meta/lib/oeqa/selftest/cases/spdx.py +9 -13
@@ -142,35 +142,31 @@ class SPDX30Check(SPDX3CheckBase, OESelftestTestCase): def test_base_files(self): self.check_recipe_spdx( "base-files", - "{DEPLOY_DIR_SPDX}/{MACHINE_ARCH}/packages/base-files.spdx.json", + "{DEPLOY_DIR_SPDX}/{MACHINE_ARCH}/packages/package-base-files.spdx.json", ) - def test_gcc_include_source(self): - import oe.spdx30 - objset = self.check_recipe_spdx( "gcc", - "{DEPLOY_DIR_SPDX}/{SSTATE_PKGARCH}/recipes/gcc.spdx.json", - extraconf=textwrap.dedent( - """\ + "{DEPLOY_DIR_SPDX}/{SSTATE_PKGARCH}/recipes/recipe-gcc.spdx.json", + extraconf="""\ SPDX_INCLUDE_SOURCES = "1" - """ - ), + """, ) gcc_pv = get_bb_var("PV", "gcc") - filename = f'gcc-{gcc_pv}/README' + filename = f"gcc-{gcc_pv}/README" found = False for software_file in objset.foreach_type(oe.spdx30.software_File): if software_file.name == filename: found = True - self.logger.info(f"The spdxId of {filename} in gcc.spdx.json is {software_file.spdxId}") + self.logger.info( + f"The spdxId of {filename} in recipe-gcc.spdx.json is {software_file.spdxId}" + ) break self.assertTrue( - found, - f"Not found source file {filename} in gcc.spdx.json\n" + found, f"Not found source file {filename} in recipe-gcc.spdx.json\n" ) def test_core_image_minimal(self):
Signature · 1 line
2.43.0
PATCH v2 11/11 spdx30_tasks: adapt CVE handling to new cve-check API
In reply to Kamel BouharaFrom: "Kamel Bouhara (Schneider Electric)" <[email protected]>
Changes to cve-check (see poky commit fb3f440b7d8, "cve-check: annotate CVEs during analysis") modified the get_patched_cves() API to return a set of CVE IDs instead of a dictionary of CVE metadata.
The SPDX 3 backport still expected a dictionary and attempted to call .items(), leading to:
AttributeError: 'set' object has no attribute 'items'
This patch updates the SPDX3 code to iterate directly over the CVE IDs and use oe.cve_check.decode_cve_status() to retrieve the mapping, detail, and description for each CVE. This restores compatibility with the updated CVE API and matches the behavior of SPDX3 handling on Walnascar.
A warning is logged if a CVE has missing or unknown status.
--- meta/lib/oe/spdx30_tasks.py | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-)
meta/lib/oe/spdx30_tasks.py +12 -17
@@ -502,34 +502,29 @@ def create_spdx(d): cve_by_status = {} if include_vex != "none": patched_cves = oe.cve_check.get_patched_cves(d) - for cve, patched_cve in patched_cves.items(): - decoded_status = { - "mapping": patched_cve["abbrev-status"], - "detail": patched_cve["status"], - "description": patched_cve.get("justification", None) - } + for cve_id in patched_cves: + mapping, detail, description = oe.cve_check.decode_cve_status(d, cve_id) + + if not mapping or not detail: + bb.warn(f"Skipping {cve_id} — missing or unknown CVE status") + continue # If this CVE is fixed upstream, skip it unless all CVEs are # specified. if ( include_vex != "all" - and "detail" in decoded_status - and decoded_status["detail"] - in ( - "fixed-version", - "cpe-stable-backport", - ) + and "detail" in ("fixed-version", "cpe-stable-backport") ): - bb.debug(1, "Skipping %s since it is already fixed upstream" % cve) + bb.debug(1, "Skipping %s since it is already fixed upstream" % cve_id) continue - spdx_cve = build_objset.new_cve_vuln(cve) + spdx_cve = build_objset.new_cve_vuln(cve_id) build_objset.set_element_alias(spdx_cve) - cve_by_status.setdefault(decoded_status["mapping"], {})[cve] = ( + cve_by_status.setdefault(mapping, {})[cve_id] = ( spdx_cve, - decoded_status["detail"], - decoded_status["description"], + detail, + description, ) cpe_ids = oe.cve_check.get_cpe_ids(d.getVar("CVE_PRODUCT"), d.getVar("CVE_VERSION"))
Signature · 1 line
2.43.0
Testing this series on the autobuilder shows oeselftest failing with a number of spdx related issues.
See:
https://errors.yoctoproject.org/Errors/Details/885530/
Thanks,
Steve
Quoted 71 lines · Kamel Bouhara via lists.openembedded.org
Hello,
This v2 series backports SPDX 3.0 support from the upstream Walnascar branch to Scarthgap (Yocto Project 5.0 LTS), including the corresponding test suite and fixes for integration issues found during testing.
The motivation remains the same as in v1, to bring complete SPDX 3.0 support to the latest LTS release, ensuring that long-term supported builds benefit SBOM generation capabilities. Scarthgap is under maintenance until 2028, and SPDX 3.0 is now an essential part of compliance workflows.
Kamel
Hongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (7):
classes-global/license: Move functions to library code lib/license: Move package license skip to library
lib: oe: license: Add missing import classes-recipe/image: Add image file manifest
selftest: spdx: Add SPDX 3.0 test cases
lib: oeqa: spdx: Add tests for extra options spdx 3.0: Rework how SPDX aliases are linkedKamel Bouhara (Schneider Electric) (3):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_files
spdx30_tasks: adapt CVE handling to new cve-check APImeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - .../create-spdx-image-3.0.bbclass | 85 + .../create-spdx-sdk-3.0.bbclass | 74 + meta/classes-recipe/image.bbclass | 58 + meta/classes-recipe/license_image.bbclass | 14 +- meta/classes-recipe/nospdx.bbclass | 13 + meta/classes/create-spdx-3.0.bbclass | 200 + meta/classes/spdx-common.bbclass | 99 + meta/lib/oe/__init__.py | 2 +- meta/lib/oe/license.py | 203 + meta/lib/oe/sbom30.py | 1096 ++++ meta/lib/oe/spdx30.py | 5593 +++++++++++++++++ meta/lib/oe/spdx30_tasks.py | 1343 ++++ meta/lib/oe/spdx_common.py | 244 + meta/lib/oeqa/selftest/cases/spdx.py | 248 +- 16 files changed, 9262 insertions(+), 216 deletions(-) create mode 100644 meta/classes-recipe/create-spdx-image-3.0.bbclass create mode 100644 meta/classes-recipe/create-spdx-sdk-3.0.bbclass create mode 100644 meta/classes-recipe/nospdx.bbclass create mode 100644 meta/classes/create-spdx-3.0.bbclass create mode 100644 meta/classes/spdx-common.bbclass create mode 100644 meta/lib/oe/sbom30.py create mode 100644 meta/lib/oe/spdx30.py create mode 100644 meta/lib/oe/spdx30_tasks.py create mode 100644 meta/lib/oe/spdx_common.py--
2.43.0-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#225098): https://lists.openembedded.org/g/openembedded-core/message/225098
Mute This Topic: https://lists.openembedded.org/mt/115849813/3620601
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 3 lines · Steve Sakoman
Testing this series on the autobuilder shows oeselftest failing with a number of spdx related issues.
Hi Steve,
Quoted 4 lines
See:
Thanks for the report.
I’ve been able to reproduce the same issues locally.
I forgot to run oe-selftest before sending v2 of the series.
I’m preparing an update to fix these and will send a v3 shortly.
Thanks again for catching this!
Kamel
Quoted 74 lines
Thanks,
Steve
Quoted 59 lines · Kamel Bouhara via lists.openembedded.org
Hello,
This v2 series backports SPDX 3.0 support from the upstream Walnascar branch to Scarthgap (Yocto Project 5.0 LTS), including the corresponding test suite and fixes for integration issues found during testing.
The motivation remains the same as in v1, to bring complete SPDX 3.0 support to the latest LTS release, ensuring that long-term supported builds benefit SBOM generation capabilities. Scarthgap is under maintenance until 2028, and SPDX 3.0 is now an essential part of compliance workflows.
Kamel
Hongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (7):
classes-global/license: Move functions to library code lib/license: Move package license skip to library
lib: oe: license: Add missing import classes-recipe/image: Add image file manifest
selftest: spdx: Add SPDX 3.0 test cases
lib: oeqa: spdx: Add tests for extra options spdx 3.0: Rework how SPDX aliases are linkedKamel Bouhara (Schneider Electric) (3):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_files
spdx30_tasks: adapt CVE handling to new cve-check APImeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - .../create-spdx-image-3.0.bbclass | 85 + .../create-spdx-sdk-3.0.bbclass | 74 + meta/classes-recipe/image.bbclass | 58 + meta/classes-recipe/license_image.bbclass | 14 +- meta/classes-recipe/nospdx.bbclass | 13 + meta/classes/create-spdx-3.0.bbclass | 200 + meta/classes/spdx-common.bbclass | 99 + meta/lib/oe/__init__.py | 2 +- meta/lib/oe/license.py | 203 + meta/lib/oe/sbom30.py | 1096 ++++ meta/lib/oe/spdx30.py | 5593 +++++++++++++++++ meta/lib/oe/spdx30_tasks.py | 1343 ++++ meta/lib/oe/spdx_common.py | 244 + meta/lib/oeqa/selftest/cases/spdx.py | 248 +- 16 files changed, 9262 insertions(+), 216 deletions(-) create mode 100644 meta/classes-recipe/create-spdx-image-3.0.bbclass create mode 100644 meta/classes-recipe/create-spdx-sdk-3.0.bbclass create mode 100644 meta/classes-recipe/nospdx.bbclass create mode 100644 meta/classes/create-spdx-3.0.bbclass create mode 100644 meta/classes/spdx-common.bbclass create mode 100644 meta/lib/oe/sbom30.py create mode 100644 meta/lib/oe/spdx30.py create mode 100644 meta/lib/oe/spdx30_tasks.py create mode 100644 meta/lib/oe/spdx_common.pyQuoted 6 lines
--
2.43.0
Quoted 8 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#225132): https://lists.openembedded.org/g/openembedded-core/message/225132
Mute This Topic: https://lists.openembedded.org/mt/115849813/5236779
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Hi Kamel,
We spoke on IRC when I was testing v1 of this bundle, and I suggested backporting this change [1]. I have now tested the v2 bundle with the projects I am working on and encountered the same errors related to the populate_sysroot task. When I applied [1] on top of the v2 bundle, everything worked as expected. Could you please consider backporting patch [1] and including it in this bundle?
Regards,
Fabio
[1] https://git.openembedded.org/openembedded-core/commit/?id=8b506f327838b885bfeb2cf144f43c8be68b8591
Quoted 71 lines · Kamel Bouhara via lists.openembedded.org
Hello,
This v2 series backports SPDX 3.0 support from the upstream Walnascar branch to Scarthgap (Yocto Project 5.0 LTS), including the corresponding test suite and fixes for integration issues found during testing.
The motivation remains the same as in v1, to bring complete SPDX 3.0 support to the latest LTS release, ensuring that long-term supported builds benefit SBOM generation capabilities. Scarthgap is under maintenance until 2028, and SPDX 3.0 is now an essential part of compliance workflows.
Kamel
Hongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (7):
classes-global/license: Move functions to library code lib/license: Move package license skip to library
lib: oe: license: Add missing import classes-recipe/image: Add image file manifest
selftest: spdx: Add SPDX 3.0 test cases
lib: oeqa: spdx: Add tests for extra options spdx 3.0: Rework how SPDX aliases are linkedKamel Bouhara (Schneider Electric) (3):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_files
spdx30_tasks: adapt CVE handling to new cve-check APImeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - .../create-spdx-image-3.0.bbclass | 85 + .../create-spdx-sdk-3.0.bbclass | 74 + meta/classes-recipe/image.bbclass | 58 + meta/classes-recipe/license_image.bbclass | 14 +- meta/classes-recipe/nospdx.bbclass | 13 + meta/classes/create-spdx-3.0.bbclass | 200 + meta/classes/spdx-common.bbclass | 99 + meta/lib/oe/__init__.py | 2 +- meta/lib/oe/license.py | 203 + meta/lib/oe/sbom30.py | 1096 ++++ meta/lib/oe/spdx30.py | 5593 +++++++++++++++++ meta/lib/oe/spdx30_tasks.py | 1343 ++++ meta/lib/oe/spdx_common.py | 244 + meta/lib/oeqa/selftest/cases/spdx.py | 248 +- 16 files changed, 9262 insertions(+), 216 deletions(-) create mode 100644 meta/classes-recipe/create-spdx-image-3.0.bbclass create mode 100644 meta/classes-recipe/create-spdx-sdk-3.0.bbclass create mode 100644 meta/classes-recipe/nospdx.bbclass create mode 100644 meta/classes/create-spdx-3.0.bbclass create mode 100644 meta/classes/spdx-common.bbclass create mode 100644 meta/lib/oe/sbom30.py create mode 100644 meta/lib/oe/spdx30.py create mode 100644 meta/lib/oe/spdx30_tasks.py create mode 100644 meta/lib/oe/spdx_common.py--
2.43.0-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#225098): https://lists.openembedded.org/g/openembedded-core/message/225098
Mute This Topic: https://lists.openembedded.org/mt/115849813/6083838
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Hello,
I have tried this patch serias and I see ton of "missing or unknown CVE status" warnings. Example for curl recipe:
WARNING: curl-8.7.1-r0 do_create_spdx: Skipping CVE-2024-11053 - missing or unknown CVE status
WARNING: curl-8.7.1-r0 do_create_spdx: Skipping CVE-2024-7264 - missing or unknown CVE status
WARNING: curl-8.7.1-r0 do_create_spdx: Skipping CVE-2024-8096 - missing or unknown CVE status
WARNING: curl-8.7.1-r0 do_create_spdx: Skipping CVE-2025-0167 - missing or unknown CVE status
WARNING: curl-8.7.1-r0 do_create_spdx: Skipping CVE-2024-6197 - missing or unknown CVE status
WARNING: curl-8.7.1-r0 do_create_spdx: Skipping CVE-2024-9681 - missing or unknown CVE status Looks like it is generated for every CVE patch in every recipe built.
What I did is cherry-picking this series and adding following to my distro config and building my image:
INHERIT_DISTRO:remove = "create-spdx"
INHERIT_DISTRO:append = " create-spdx-3.0"
When trying with pure poky, I added following to local.conf:
INHERIT:remove = "create-spdx"
INHERIT:append = " create-spdx-3.0"
Inheriting cve-check did not help.
When building oe-core master, I don't experience such warnings. So it looks like something is missing in this backport series.
Peter
Quoted 72 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Kamel Bouhara via lists.openembedded.org
Sent: Monday, October 20, 2025 9:10
To: [email protected]
Cc: [email protected]; [email protected]; Miquel Raynal <[email protected]>; [email protected]; [email protected]; Pascal Eberhard <[email protected]>; Kamel Bouhara <[email protected]>
Subject: [OE-core] [scarthgap v2 00/11] backport: SPDX 3.0 support to ScarthgapHello,
This v2 series backports SPDX 3.0 support from the upstream Walnascar branch to Scarthgap (Yocto Project 5.0 LTS), including the corresponding test suite and fixes for integration issues found during testing.
The motivation remains the same as in v1, to bring complete SPDX 3.0 support to the latest LTS release, ensuring that long-term supported builds benefit SBOM generation capabilities. Scarthgap is under maintenance until 2028, and SPDX 3.0 is now an essential part of compliance workflows.
Kamel
Hongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (7):
classes-global/license: Move functions to library code lib/license: Move package license skip to library
lib: oe: license: Add missing import classes-recipe/image: Add image file manifest
selftest: spdx: Add SPDX 3.0 test cases
lib: oeqa: spdx: Add tests for extra options spdx 3.0: Rework how SPDX aliases are linkedKamel Bouhara (Schneider Electric) (3):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_files
spdx30_tasks: adapt CVE handling to new cve-check APImeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - .../create-spdx-image-3.0.bbclass | 85 + .../create-spdx-sdk-3.0.bbclass | 74 + meta/classes-recipe/image.bbclass | 58 + meta/classes-recipe/license_image.bbclass | 14 +- meta/classes-recipe/nospdx.bbclass | 13 + meta/classes/create-spdx-3.0.bbclass | 200 + meta/classes/spdx-common.bbclass | 99 + meta/lib/oe/__init__.py | 2 +- meta/lib/oe/license.py | 203 + meta/lib/oe/sbom30.py | 1096 ++++ meta/lib/oe/spdx30.py | 5593 +++++++++++++++++ meta/lib/oe/spdx30_tasks.py | 1343 ++++ meta/lib/oe/spdx_common.py | 244 + meta/lib/oeqa/selftest/cases/spdx.py | 248 +- 16 files changed, 9262 insertions(+), 216 deletions(-) create mode 100644 meta/classes-recipe/create-spdx-image-3.0.bbclass create mode 100644 meta/classes-recipe/create-spdx-sdk-3.0.bbclass create mode 100644 meta/classes-recipe/nospdx.bbclass create mode 100644 meta/classes/create-spdx-3.0.bbclass create mode 100644 meta/classes/spdx-common.bbclass create mode 100644 meta/lib/oe/sbom30.py create mode 100644 meta/lib/oe/spdx30.py create mode 100644 meta/lib/oe/spdx30_tasks.py create mode 100644 meta/lib/oe/spdx_common.py--
2.43.0
Quoted 2 lines · Peter Marko via lists.openembedded.org
Hello,
Hello Peter,
Quoted 10 lines
I have tried this patch serias and I see ton of "missing or unknown CVE status" warnings. Example for curl recipe:
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-11053 - missing or unknown CVE status
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-7264 - missing or unknown CVE status
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-8096 - missing or unknown CVE status
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2025-0167 - missing or unknown CVE status
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-6197 - missing or unknown CVE status
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-9681 - missing or unknown CVE status Looks like it is generated for every CVE patch in every recipe built.
Quoted 7 lines
What I did is cherry-picking this series and adding following to my distro config and building my image:
INHERIT_DISTRO:remove = "create-spdx"
INHERIT_DISTRO:append = " create-spdx-3.0"
When trying with pure poky, I added following to local.conf:
INHERIT:remove = "create-spdx"
INHERIT:append = " create-spdx-3.0"
Thanks for testing and for the detailed feedback.
I haven’t yet tested this backport series with a pure Poky setup, so I’ll start there to reproduce the warnings you’re seeing. Once I confirm how the CVE decoding behaves in that environment, I’ll follow up with a fix or updated guidance.
Thanks again for pointing this out.
Kamel
Quoted 81 lines
Inheriting cve-check did not help.
When building oe-core master, I don't experience such warnings. So it looks like something is missing in this backport series.Peter
Quoted 70 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Kamel Bouhara via lists.openembedded.org
Sent: Monday, October 20, 2025 9:10
To: [email protected]
Cc: [email protected]; [email protected]; Miquel Raynal <[email protected]>; [email protected]; [email protected]; Pascal Eberhard <[email protected]>; Kamel Bouhara <[email protected]>
Subject: [OE-core] [scarthgap v2 00/11] backport: SPDX 3.0 support to ScarthgapHello,
This v2 series backports SPDX 3.0 support from the upstream Walnascar branch to Scarthgap (Yocto Project 5.0 LTS), including the corresponding test suite and fixes for integration issues found during testing.
The motivation remains the same as in v1, to bring complete SPDX 3.0 support to the latest LTS release, ensuring that long-term supported builds benefit SBOM generation capabilities. Scarthgap is under maintenance until 2028, and SPDX 3.0 is now an essential part of compliance workflows.
Kamel
Hongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (7):
classes-global/license: Move functions to library code lib/license: Move package license skip to library
lib: oe: license: Add missing import classes-recipe/image: Add image file manifest
selftest: spdx: Add SPDX 3.0 test cases
lib: oeqa: spdx: Add tests for extra options spdx 3.0: Rework how SPDX aliases are linkedKamel Bouhara (Schneider Electric) (3):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_files
spdx30_tasks: adapt CVE handling to new cve-check APImeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - .../create-spdx-image-3.0.bbclass | 85 + .../create-spdx-sdk-3.0.bbclass | 74 + meta/classes-recipe/image.bbclass | 58 + meta/classes-recipe/license_image.bbclass | 14 +- meta/classes-recipe/nospdx.bbclass | 13 + meta/classes/create-spdx-3.0.bbclass | 200 + meta/classes/spdx-common.bbclass | 99 + meta/lib/oe/__init__.py | 2 +- meta/lib/oe/license.py | 203 + meta/lib/oe/sbom30.py | 1096 ++++ meta/lib/oe/spdx30.py | 5593 +++++++++++++++++ meta/lib/oe/spdx30_tasks.py | 1343 ++++ meta/lib/oe/spdx_common.py | 244 + meta/lib/oeqa/selftest/cases/spdx.py | 248 +- 16 files changed, 9262 insertions(+), 216 deletions(-) create mode 100644 meta/classes-recipe/create-spdx-image-3.0.bbclass create mode 100644 meta/classes-recipe/create-spdx-sdk-3.0.bbclass create mode 100644 meta/classes-recipe/nospdx.bbclass create mode 100644 meta/classes/create-spdx-3.0.bbclass create mode 100644 meta/classes/spdx-common.bbclass create mode 100644 meta/lib/oe/sbom30.py create mode 100644 meta/lib/oe/spdx30.py create mode 100644 meta/lib/oe/spdx30_tasks.py create mode 100644 meta/lib/oe/spdx_common.pyQuoted 2 lines
--
2.43.0
Quoted 8 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#225190): https://lists.openembedded.org/g/openembedded-core/message/225190
Mute This Topic: https://lists.openembedded.org/mt/115849813/5236779
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Quoted 24 lines · Kamel Bouhara
Quoted 2 lines · Peter Marko via lists.openembedded.org
Hello,
Hello Peter,
Quoted 10 lines
I have tried this patch serias and I see ton of "missing or unknown CVE status" warnings. Example for curl recipe:
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-11053 - missing or unknown CVE status
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-7264 - missing or unknown CVE status
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-8096 - missing or unknown CVE status
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2025-0167 - missing or unknown CVE status
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-6197 - missing or unknown CVE status
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-9681 - missing or unknown CVE status Looks like it is generated for every CVE patch in every recipe built.Quoted 7 lines
What I did is cherry-picking this series and adding following to my distro config and building my image:
INHERIT_DISTRO:remove = "create-spdx"
INHERIT_DISTRO:append = " create-spdx-3.0"
When trying with pure poky, I added following to local.conf:
INHERIT:remove = "create-spdx"
INHERIT:append = " create-spdx-3.0"
Quoted 8 lines
Thanks for testing and for the detailed feedback.
I haven’t yet tested this backport series with a pure Poky setup, so I’ll start there to reproduce the warnings you’re seeing. Once I confirm how the CVE decoding behaves in that environment, I’ll follow up with a fix or updated guidance.
Thanks again for pointing this out.
Actually, I didn’t notice these warnings in my own tests on OE-Core Scarthgap, but they are there too.
They’re related to Marta’s cve-check changes (fb3f440b7d8), which added richer CVE metadata and product/vendor matching through decode_cve_status() and has_cve_product_match().
Since those updates aren’t fully backported in Scarthgap, some CVEs show as unknown during SPDX generation.
@Joshua: would you suggest we suppress these warnings in Scarthgap, or should we handle this case differently to better align with the upstream behavior?
Quoted 94 lines
Kamel
Quoted 81 lines
Inheriting cve-check did not help.
When building oe-core master, I don't experience such warnings. So it looks like something is missing in this backport series.Peter
Quoted 70 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Kamel Bouhara via lists.openembedded.org
Sent: Monday, October 20, 2025 9:10
To: [email protected]
Cc: [email protected]; [email protected]; Miquel Raynal <[email protected]>; [email protected]; [email protected]; Pascal Eberhard <[email protected]>; Kamel Bouhara <[email protected]>
Subject: [OE-core] [scarthgap v2 00/11] backport: SPDX 3.0 support to ScarthgapHello,
This v2 series backports SPDX 3.0 support from the upstream Walnascar branch to Scarthgap (Yocto Project 5.0 LTS), including the corresponding test suite and fixes for integration issues found during testing.
The motivation remains the same as in v1, to bring complete SPDX 3.0 support to the latest LTS release, ensuring that long-term supported builds benefit SBOM generation capabilities. Scarthgap is under maintenance until 2028, and SPDX 3.0 is now an essential part of compliance workflows.
Kamel
Hongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (7):
classes-global/license: Move functions to library code lib/license: Move package license skip to library
lib: oe: license: Add missing import classes-recipe/image: Add image file manifest
selftest: spdx: Add SPDX 3.0 test cases
lib: oeqa: spdx: Add tests for extra options spdx 3.0: Rework how SPDX aliases are linkedKamel Bouhara (Schneider Electric) (3):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_files
spdx30_tasks: adapt CVE handling to new cve-check APImeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - .../create-spdx-image-3.0.bbclass | 85 + .../create-spdx-sdk-3.0.bbclass | 74 + meta/classes-recipe/image.bbclass | 58 + meta/classes-recipe/license_image.bbclass | 14 +- meta/classes-recipe/nospdx.bbclass | 13 + meta/classes/create-spdx-3.0.bbclass | 200 + meta/classes/spdx-common.bbclass | 99 + meta/lib/oe/__init__.py | 2 +- meta/lib/oe/license.py | 203 + meta/lib/oe/sbom30.py | 1096 ++++ meta/lib/oe/spdx30.py | 5593 +++++++++++++++++ meta/lib/oe/spdx30_tasks.py | 1343 ++++ meta/lib/oe/spdx_common.py | 244 + meta/lib/oeqa/selftest/cases/spdx.py | 248 +- 16 files changed, 9262 insertions(+), 216 deletions(-) create mode 100644 meta/classes-recipe/create-spdx-image-3.0.bbclass create mode 100644 meta/classes-recipe/create-spdx-sdk-3.0.bbclass create mode 100644 meta/classes-recipe/nospdx.bbclass create mode 100644 meta/classes/create-spdx-3.0.bbclass create mode 100644 meta/classes/spdx-common.bbclass create mode 100644 meta/lib/oe/sbom30.py create mode 100644 meta/lib/oe/spdx30.py create mode 100644 meta/lib/oe/spdx30_tasks.py create mode 100644 meta/lib/oe/spdx_common.pyQuoted 2 lines
--
2.43.0Quoted 8 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#225190): https://lists.openembedded.org/g/openembedded-core/message/225190
Mute This Topic: https://lists.openembedded.org/mt/115849813/5236779
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 4 lines
--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Quoted 56 lines
-----Original Message-----
From: Kamel Bouhara <[email protected]>
Sent: Thursday, October 23, 2025 13:06
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [OE-core] [scarthgap v2 00/11] backport: SPDX 3.0 support to ScarthgapQuoted 1 line · Kamel Bouhara
On Wed, Oct 22, 2025 at 12:43:22PM +0000, Peter Marko via
Quoted 6 lines · lists.openembedded.org
Quoted 2 lines
Hello,
Hello Peter,
Quoted 1 line
I have tried this patch serias and I see ton of "missing or unknown CVE status"
warnings.
Quoted 2 lines
Quoted 2 lines
Example for curl recipe:
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-11053 - missingor unknown CVE status
Quoted 1 line
Quoted 1 line
WARNING: curl-8.7.1-r0
do_create_spdx: Skipping CVE-2024-7264 - missing orunknown CVE status
Quoted 1 line
Quoted 1 line
WARNING: curl-8.7.1-r0
do_create_spdx: Skipping CVE-2024-8096 - missing orunknown CVE status
Quoted 1 line
Quoted 1 line
WARNING: curl-8.7.1-r0
do_create_spdx: Skipping CVE-2025-0167 - missing orunknown CVE status
Quoted 1 line
Quoted 1 line
WARNING: curl-8.7.1-r0
do_create_spdx: Skipping CVE-2024-6197 - missing orunknown CVE status
Quoted 1 line
Quoted 1 line
WARNING: curl-8.7.1-r0
do_create_spdx: Skipping CVE-2024-9681 - missing orunknown CVE status
Quoted 3 lines
Quoted 3 lines
Looks like it is generated for every CVE patch in every recipe built.
What I did is cherry-picking this series and adding following to my distro
config and building my image:
Quoted 7 lines
Quoted 6 lines
INHERIT_DISTRO:remove = "create-spdx" INHERIT_DISTRO:append = " create-spdx-3.0"
When trying with pure poky, I added following to local.conf:
INHERIT:remove = "create-spdx"
INHERIT:append = " create-spdx-3.0"Quoted 8 lines
Thanks for testing and for the detailed feedback.
I haven’t yet tested this backport series with a pure Poky setup, so I’ll start there to reproduce the warnings you’re seeing. Once I confirm how the CVE decoding behaves in that environment, I’ll follow up with a fix or updated guidance.
Thanks again for pointing this out.
Actually, I didn’t notice these warnings in my own tests on OE-Core Scarthgap, but they are there too.
Quoted 6 lines
They’re related to Marta’s cve-check changes (
fb3f440b7d8), which added richer CVE metadata and product/vendor matching throughdecode_cve_status()andhas_cve_product_match().Since those updates aren’t fully backported in Scarthgap, some CVEs show as unknown during SPDX generation.
I think the problem is elsewhere - in commit "spdx30_tasks: adapt CVE handling to new cve-check API". It does not handle patches in SRC_URI properly as they are not known to function decode_cve_status.
Also, it's not "some CVEs", but "all patched CVEs", which makes the VEX information in my opinion unusable.
I'll try to send a patch this week.
Peter
Quoted 112 lines
@Joshua: would you suggest we suppress these warnings in Scarthgap, or should we handle this case differently to better align with the upstream behavior?
Quoted 16 lines
Kamel
Quoted 13 lines
Inheriting cve-check did not help.
When building oe-core master, I don't experience such warnings. So it looks like something is missing in this backport series.Peter
Quoted 7 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Kamel Bouhara via lists.openembedded.org
Sent: Monday, October 20, 2025 9:10
To: [email protected]
Cc: [email protected]; [email protected]; MiquelRaynal
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
<[email protected]>; [email protected]; [email protected]; Pascal Eberhard <[email protected]>; Kamel Bouhara <[email protected]>
Subject: [OE-core] [scarthgap v2 00/11] backport: SPDX 3.0 support toScarthgap
Quoted 59 lines
Quoted 59 lines
Quoted 59 lines
Hello,
This v2 series backports SPDX 3.0 support from the upstream Walnascar branch to Scarthgap (Yocto Project 5.0 LTS), including the corresponding test suite and fixes for integration issues found during testing.
The motivation remains the same as in v1, to bring complete SPDX 3.0 support to the latest LTS release, ensuring that long-term supported builds benefit SBOM generation capabilities. Scarthgap is under maintenance until 2028, and SPDX 3.0 is now an essential part of compliance workflows.
Kamel
Hongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (7):
classes-global/license: Move functions to library code lib/license: Move package license skip to library
lib: oe: license: Add missing import classes-recipe/image: Add image file manifest
selftest: spdx: Add SPDX 3.0 test cases
lib: oeqa: spdx: Add tests for extra options spdx 3.0: Rework how SPDX aliases are linkedKamel Bouhara (Schneider Electric) (3):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_files
spdx30_tasks: adapt CVE handling to new cve-check APImeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - .../create-spdx-image-3.0.bbclass | 85 + .../create-spdx-sdk-3.0.bbclass | 74 + meta/classes-recipe/image.bbclass | 58 + meta/classes-recipe/license_image.bbclass | 14 +- meta/classes-recipe/nospdx.bbclass | 13 + meta/classes/create-spdx-3.0.bbclass | 200 + meta/classes/spdx-common.bbclass | 99 + meta/lib/oe/__init__.py | 2 +- meta/lib/oe/license.py | 203 + meta/lib/oe/sbom30.py | 1096 ++++ meta/lib/oe/spdx30.py | 5593 +++++++++++++++++ meta/lib/oe/spdx30_tasks.py | 1343 ++++ meta/lib/oe/spdx_common.py | 244 + meta/lib/oeqa/selftest/cases/spdx.py | 248 +- 16 files changed, 9262 insertions(+), 216 deletions(-) create mode 100644 meta/classes-recipe/create-spdx-image-3.0.bbclass create mode 100644 meta/classes-recipe/create-spdx-sdk-3.0.bbclass create mode 100644 meta/classes-recipe/nospdx.bbclass create mode 100644 meta/classes/create-spdx-3.0.bbclass create mode 100644 meta/classes/spdx-common.bbclass create mode 100644 meta/lib/oe/sbom30.py create mode 100644 meta/lib/oe/spdx30.py create mode 100644 meta/lib/oe/spdx30_tasks.py create mode 100644 meta/lib/oe/spdx_common.pyQuoted 8 lines
Quoted 8 lines
Quoted 2 lines
--
2.43.0-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#225190):https://lists.openembedded.org/g/openembedded-core/message/225190
Quoted 3 lines
Quoted 3 lines
Mute This Topic: https://lists.openembedded.org/mt/115849813/5236779
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsubQuoted 8 lines
Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-
--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Quoted 60 lines · Peter
Quoted 60 lines
-----Original Message-----
From: Kamel Bouhara <[email protected]>
Sent: Thursday, October 23, 2025 13:06
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [OE-core] [scarthgap v2 00/11] backport: SPDX 3.0 support to ScarthgapQuoted 1 line · Kamel Bouhara
On Wed, Oct 22, 2025 at 12:43:22PM +0000, Peter Marko via
Quoted 6 lines · lists.openembedded.org
Quoted 2 lines
Hello,
Hello Peter,
Quoted 1 line
I have tried this patch serias and I see ton of "missing or unknown CVE status"
warnings.
Quoted 2 lines
Quoted 2 lines
Example for curl recipe:
WARNING: curl-8.7.1-r0do_create_spdx: Skipping CVE-2024-11053 - missingor unknown CVE status
Quoted 1 line
Quoted 1 line
WARNING: curl-8.7.1-r0
do_create_spdx: Skipping CVE-2024-7264 - missing orunknown CVE status
Quoted 1 line
Quoted 1 line
WARNING: curl-8.7.1-r0
do_create_spdx: Skipping CVE-2024-8096 - missing orunknown CVE status
Quoted 1 line
Quoted 1 line
WARNING: curl-8.7.1-r0
do_create_spdx: Skipping CVE-2025-0167 - missing orunknown CVE status
Quoted 1 line
Quoted 1 line
WARNING: curl-8.7.1-r0
do_create_spdx: Skipping CVE-2024-6197 - missing orunknown CVE status
Quoted 1 line
Quoted 1 line
WARNING: curl-8.7.1-r0
do_create_spdx: Skipping CVE-2024-9681 - missing orunknown CVE status
Quoted 3 lines
Quoted 3 lines
Looks like it is generated for every CVE patch in every recipe built.
What I did is cherry-picking this series and adding following to my distro
config and building my image:
Quoted 7 lines
Quoted 6 lines
INHERIT_DISTRO:remove = "create-spdx" INHERIT_DISTRO:append = " create-spdx-3.0"
When trying with pure poky, I added following to local.conf:
INHERIT:remove = "create-spdx"
INHERIT:append = " create-spdx-3.0"Quoted 8 lines
Thanks for testing and for the detailed feedback.
I haven’t yet tested this backport series with a pure Poky setup, so I’ll start there to reproduce the warnings you’re seeing. Once I confirm how the CVE decoding behaves in that environment, I’ll follow up with a fix or updated guidance.
Thanks again for pointing this out.
Actually, I didn’t notice these warnings in my own tests on OE-Core Scarthgap, but they are there too.
They’re related to Marta’s cve-check changes (
fb3f440b7d8), which added richer CVE metadata and product/vendor matching throughdecode_cve_status()andhas_cve_product_match().
Quoted 7 lines
Quoted 2 lines
Since those updates aren’t fully backported in Scarthgap, some CVEs show as unknown during SPDX generation.
I think the problem is elsewhere - in commit "
spdx30_tasks: adapt CVE handling to new cve-check API". It does not handle patches inSRC_URIproperly as they are not known to functiondecode_cve_status.Also, it's not "some CVEs", but "all patched CVEs", which makes the VEX information in my opinion unusable.
I see your point. My current SPDX3 patch treats all CVEs from get_patched_cves() the same, which includes those from SRC_URI and leads to losing VEX information.
Quoted 2 lines
I'll try to send a patch this week.
Ok thanks.
Quoted 115 lines
Peter
Quoted 112 lines
@Joshua: would you suggest we suppress these warnings in Scarthgap, or should we handle this case differently to better align with the upstream behavior?
Quoted 16 lines
Kamel
Quoted 13 lines
Inheriting cve-check did not help.
When building oe-core master, I don't experience such warnings. So it looks like something is missing in this backport series.Peter
Quoted 7 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Kamel Bouhara via lists.openembedded.org
Sent: Monday, October 20, 2025 9:10
To: [email protected]
Cc: [email protected]; [email protected]; MiquelRaynal
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
<[email protected]>; [email protected]; [email protected]; Pascal Eberhard <[email protected]>; Kamel Bouhara <[email protected]>
Subject: [OE-core] [scarthgap v2 00/11] backport: SPDX 3.0 support toScarthgap
Quoted 59 lines
Quoted 59 lines
Quoted 59 lines
Hello,
This v2 series backports SPDX 3.0 support from the upstream Walnascar branch to Scarthgap (Yocto Project 5.0 LTS), including the corresponding test suite and fixes for integration issues found during testing.
The motivation remains the same as in v1, to bring complete SPDX 3.0 support to the latest LTS release, ensuring that long-term supported builds benefit SBOM generation capabilities. Scarthgap is under maintenance until 2028, and SPDX 3.0 is now an essential part of compliance workflows.
Kamel
Hongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (7):
classes-global/license: Move functions to library code lib/license: Move package license skip to library
lib: oe: license: Add missing import classes-recipe/image: Add image file manifest
selftest: spdx: Add SPDX 3.0 test cases
lib: oeqa: spdx: Add tests for extra options spdx 3.0: Rework how SPDX aliases are linkedKamel Bouhara (Schneider Electric) (3):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_files
spdx30_tasks: adapt CVE handling to new cve-check APImeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - .../create-spdx-image-3.0.bbclass | 85 + .../create-spdx-sdk-3.0.bbclass | 74 + meta/classes-recipe/image.bbclass | 58 + meta/classes-recipe/license_image.bbclass | 14 +- meta/classes-recipe/nospdx.bbclass | 13 + meta/classes/create-spdx-3.0.bbclass | 200 + meta/classes/spdx-common.bbclass | 99 + meta/lib/oe/__init__.py | 2 +- meta/lib/oe/license.py | 203 + meta/lib/oe/sbom30.py | 1096 ++++ meta/lib/oe/spdx30.py | 5593 +++++++++++++++++ meta/lib/oe/spdx30_tasks.py | 1343 ++++ meta/lib/oe/spdx_common.py | 244 + meta/lib/oeqa/selftest/cases/spdx.py | 248 +- 16 files changed, 9262 insertions(+), 216 deletions(-) create mode 100644 meta/classes-recipe/create-spdx-image-3.0.bbclass create mode 100644 meta/classes-recipe/create-spdx-sdk-3.0.bbclass create mode 100644 meta/classes-recipe/nospdx.bbclass create mode 100644 meta/classes/create-spdx-3.0.bbclass create mode 100644 meta/classes/spdx-common.bbclass create mode 100644 meta/lib/oe/sbom30.py create mode 100644 meta/lib/oe/spdx30.py create mode 100644 meta/lib/oe/spdx30_tasks.py create mode 100644 meta/lib/oe/spdx_common.pyQuoted 8 lines
Quoted 8 lines
Quoted 2 lines
--
2.43.0-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#225190):https://lists.openembedded.org/g/openembedded-core/message/225190
Quoted 3 lines
Quoted 3 lines
Mute This Topic: https://lists.openembedded.org/mt/115849813/5236779
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsubQuoted 8 lines
Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-
--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com