backport: SPDX 3.0 support to Scarthgap
v4 cover backport: SPDX 3.0 support to Scarthgap
Hello,
This is the v4 series to backport SPDX 3.0 support from upstream Walnascar to Scarthgap (Yocto Project 5.0 LTS).
Changes since v2:
-----------------
Cherry-picked commits:
c5b5136bf8: Exclude do_create_spdx from automatic sysroot extension.
03c6ace6c6: Fix SPDX_VERSION handling in selftests.
7be5a6e699: Add tar test for SPDX 2.2.
Local fix:
7e14a5b966: Align DEPLOY_DIR_SPDX in create-spdx-2.2.bbclass with
${SPDX_VERSION} layout, restoring successful SPDX 2.2 selftests.
Changes since v3:
-----------------
Cherry-picked commits:
29d3f8ad4: classes/create-spdx-2.2: Handle empty packages
Greetings,
Kamel
Hongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-share
Joshua Watt (11):
classes-global/license: Move functions to library code classes-global/staging: Exclude do_create_spdx from automatic sysroot
extension
lib/license: Move package license skip to library
lib: oe: license: Add missing import
classes-recipe/image: Add image file manifest classes-recipe/baremetal-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
oeqa: spdx: Add tar test for SPDX 2.2 classes/create-spdx-2.2: Handle empty packages
Kamel Bouhara (Schneider Electric) (4):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute in add_download_files classes/create-spdx-2.2: align DEPLOY_DIR_SPDX with SPDX_VERSION
layout
spdx30_tasks: adapt CVE handling to new cve-check API
Richard Purdie (1):
selftest/spdx: Fix for SPDX_VERSION addition
meta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - meta/classes-global/staging.bbclass | 9 +- meta/classes-recipe/baremetal-image.bbclass | 32 +- .../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-2.2.bbclass | 85 +- 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 | 256 +- 19 files changed, 9348 insertions(+), 264 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 v4 1/17 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.
Patchtest results for [scarthgap v4 01/17] backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
---
Testing patch /home/patchtest/share/mboxes/scarthgap-v4-01-17-backport-SPDX-3.0-fixes-and-tasks-from-upstream-version-Walnascar.patch
FAIL: test max line length: Patch line too long (current length 216, maximum is 200) (test_metadata.TestMetadata.test_max_line_length)
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest src uri left files: Patch cannot be merged (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: Patch cannot be merged (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!
Re: Patchtest results for [scarthgap v4 01/17] backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
Quoted 4 lines · On Fri, Nov 07, 2025 at 01:37:09PM +0000…
Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
Hi Joshua,
Quoted 5 lines
---
Testing patch/home/patchtest/share/mboxes/scarthgap-v4-01-17-backport-SPDX-3.0-fixes-and-tasks-from-upstream-version-Walnascar.patchFAIL: test max line length: Patch line too long (current length 216, maximum is 200) (test_metadata.TestMetadata.test_max_line_length)
Do you think this minor formatting issue warrants sending a v5 series, or can we proceed with v4 as-is since all functional and style checks passed?
Quoted 27 lines
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)SKIP: pretest src uri left files: Patch cannot be merged (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: Patch cannot be merged (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)---
Quoted 8 lines
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!
--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
PATCH v4 2/17 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 v4 3/17 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 v4 4/17 classes-global/staging: Exclude do_create_spdx from automatic sysroot extension
In reply to Kamel BouharaFrom: Joshua Watt <[email protected]>
do_create_spdx is a outlier in that it doesn't need the RSS to be extended just because it depends on do_populate_sysroot. In fact, it only depends on do_populate_sysroot so it can see the actual recipes sysroot, and attempting to extend the sysroot can cause problems for some recipes (e.g. if a recipe does do_populate_sysroot[noexec] = "1")
As such, explicitly exclude do_create_spdx from extending the sysroot just because it depends on do_populate_sysroot.
--- meta/classes-global/staging.bbclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
meta/classes-global/staging.bbclass +8 -1
@@ -652,10 +652,17 @@ python do_prepare_recipe_sysroot () { addtask do_prepare_recipe_sysroot before do_configure after do_fetch python staging_taskhandler() { + EXCLUDED_TASKS = ( + "do_prepare_recipe_sysroot", + "do_create_spdx", + ) bbtasks = e.tasklist for task in bbtasks: + if task in EXCLUDED_TASKS: + continue + deps = d.getVarFlag(task, "depends") - if task != 'do_prepare_recipe_sysroot' and (task == "do_configure" or (deps and "populate_sysroot" in deps)): + if task == "do_configure" or (deps and "populate_sysroot" in deps): d.prependVarFlag(task, "prefuncs", "extend_recipe_sysroot ") } staging_taskhandler[eventmask] = "bb.event.RecipeTaskPreProcess"
Signature · 1 line
2.43.0
PATCH v4 5/17 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 v4 6/17 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 v4 7/17 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 v4 8/17 classes-recipe/baremetal-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 so write out a manifest in do_image_complete. The format of the manifest is the same as the one in image.bbclass
--- meta/classes-recipe/baremetal-image.bbclass | 32 +++++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-)
meta/classes-recipe/baremetal-image.bbclass +29 -3
@@ -30,6 +30,9 @@ BAREMETAL_BINNAME ?= "hello_baremetal_${MACHINE}" IMAGE_LINK_NAME ?= "baremetal-helloworld-image-${MACHINE}" IMAGE_NAME_SUFFIX ?= "" +IMAGE_OUTPUT_MANIFEST_DIR = "${WORKDIR}/deploy-image-output-manifest" +IMAGE_OUTPUT_MANIFEST = "${IMAGE_OUTPUT_MANIFEST_DIR}/manifest.json" + do_rootfs[dirs] = "${IMGDEPLOYDIR} ${DEPLOY_DIR_IMAGE}" do_image(){
@@ -37,8 +40,28 @@ do_image(){ install ${D}/${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.elf } -do_image_complete(){ - : +python do_image_complete(){ + from pathlib import Path + import json + + data = { + "taskname": "do_image", + "imagetype": "baremetal-image", + "images": [] + } + + img_deploy_dir = Path(d.getVar("IMGDEPLOYDIR")) + + for child in img_deploy_dir.iterdir(): + if not child.is_file() or child.is_symlink(): + continue + + data["images"].append({ + "filename": child.name, + }) + + with open(d.getVar("IMAGE_OUTPUT_MANIFEST"), "w") as f: + json.dump([data], f) } python do_rootfs(){
@@ -62,6 +85,7 @@ python do_rootfs(){ bb.utils.mkdirhier(sysconfdir) execute_pre_post_process(d, d.getVar('ROOTFS_POSTPROCESS_COMMAND')) + execute_pre_post_process(d, d.getVar("ROOTFS_POSTUNINSTALL_COMMAND")) }
@@ -72,6 +96,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 () {
@@ -140,5 +166,5 @@ python(){ else: deps += " %s:%s" % (dep, task) return deps - d.appendVarFlag('do_image', 'depends', extraimage_getdepends('do_populate_sysroot')) + d.appendVarFlag('do_image', 'depends', extraimage_getdepends('do_populate_sysroot')) }
Signature · 1 line
2.43.0
PATCH v4 9/17 selftest/spdx: Fix for SPDX_VERSION addition
In reply to Kamel BouharaFrom: Richard Purdie <[email protected]>
Update the test for the addition of SPDX_VERSION to the deploy path.
--- meta/lib/oeqa/selftest/cases/spdx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/spdx.py +2 -1
@@ -25,10 +25,11 @@ INHERIT += "create-spdx" deploy_dir = get_bb_var("DEPLOY_DIR") machine_var = get_bb_var("MACHINE") + spdx_version = get_bb_var("SPDX_VERSION") # 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)
Signature · 1 line
2.43.0
PATCH v4 10/17 classes/create-spdx-2.2: align DEPLOY_DIR_SPDX with SPDX_VERSION layout
In reply to Kamel BouharaFrom: "Kamel Bouhara (Schneider Electric)" <[email protected]>
Upstream commit 544d46e4169a ("selftest/spdx: Fix for SPDX_VERSION addition") updated the selftests to expect SPDX artifacts under:
${DEPLOY_DIR}/spdx/${SPDX_VERSION}/However, in this branch the effective SPDX output was still being written to:
${DEPLOY_DIR}/spdx/${PACKAGE_ARCH}/without the version subdirectory. This caused SPDX selftests such as test_spdx_tar to fail with missing file errors, e.g.:
AssertionError: .../deploy/spdx/SPDX-1.1/core2-64/packages/tar.spdx.json does not exist
Update create-spdx-2.2.bbclass so that DEPLOY_DIR_SPDX includes ${SPDX_VERSION}, matching the expected deploy structure and restoring successful SPDX selftests.
--- meta/classes/create-spdx-2.2.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/create-spdx-2.2.bbclass +1 -1
@@ -4,7 +4,7 @@ # SPDX-License-Identifier: GPL-2.0-only # -DEPLOY_DIR_SPDX ??= "${DEPLOY_DIR}/spdx" +DEPLOY_DIR_SPDX ??= "${DEPLOY_DIR}/spdx/${SPDX_VERSION}" # The product name that the CVE database uses. Defaults to BPN, but may need to # be overriden per recipe (for example tiff.bb sets CVE_PRODUCT=libtiff).
Signature · 1 line
2.43.0
PATCH v4 11/17 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")
@@ -29,7 +34,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", spdx_version, machine_dir, high_level_dir, spdx_file) + full_file_path = os.path.join( + deploy_dir, "spdx", spdx_version, arch_dir, high_level_dir, spdx_file + ) try: os.remove(full_file_path)
@@ -44,8 +51,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)
@@ -53,3 +65,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 v4 12/17 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
@@ -110,6 +110,7 @@ class SPDX3CheckBase(object): "SDKMACHINE", "SDK_DEPLOY", "SPDX_VERSION", + "SSTATE_PKGARCH", "TOOLCHAIN_OUTPUTNAME", ], target_name,
@@ -136,6 +137,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 v4 13/17 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):
@@ -73,8 +75,6 @@ class SPDX3CheckBase(object): """ def check_spdx_file(self, filename): - import oe.spdx30 - self.assertExists(filename) # Read the file
@@ -86,13 +86,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:
@@ -120,11 +123,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), )
@@ -188,12 +197,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 v4 14/17 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
@@ -143,35 +143,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 v4 15/17 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
PATCH v4 16/17 oeqa: spdx: Add tar test for SPDX 2.2
In reply to Kamel BouharaFrom: Joshua Watt <[email protected]>
The base-files test for SPDX 2.2 did not give good coverage, since base-files doesn't have any dependencies. Add building tar as another test which more fully exercises the code
--- meta/lib/oeqa/selftest/cases/spdx.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
meta/lib/oeqa/selftest/cases/spdx.py +5 -2
@@ -31,10 +31,10 @@ class SPDX22Check(OESelftestTestCase): self.write_config(config) deploy_dir = get_bb_var("DEPLOY_DIR") - machine_var = get_bb_var("MACHINE") + arch_dir = get_bb_var("PACKAGE_ARCH", target_name) spdx_version = get_bb_var("SPDX_VERSION") # qemux86-64 creates the directory qemux86_64 - machine_dir = machine_var.replace("-", "_") + #arch_dir = arch_var.replace("-", "_") full_file_path = os.path.join( deploy_dir, "spdx", spdx_version, arch_dir, high_level_dir, spdx_file
@@ -68,6 +68,9 @@ class SPDX22Check(OESelftestTestCase): def test_spdx_base_files(self): self.check_recipe_spdx("packages", "base-files.spdx.json", "base-files") + def test_spdx_tar(self): + self.check_recipe_spdx("packages", "tar.spdx.json", "tar") + class SPDX3CheckBase(object): """
Signature · 1 line
2.43.0
PATCH v4 17/17 classes/create-spdx-2.2: Handle empty packages
In reply to Kamel BouharaFrom: Joshua Watt <[email protected]>
When combining an SPDX document, the package list might be empty (e.g. a baremetal image). Handle this case instead of erroring out
--- meta/classes/create-spdx-2.2.bbclass | 83 ++++++++++++++-------------- 1 file changed, 42 insertions(+), 41 deletions(-)
meta/classes/create-spdx-2.2.bbclass +42 -41
@@ -1044,52 +1044,53 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages, spdx doc.packages.append(image) - for name in sorted(packages.keys()): - if name not in providers: - bb.fatal("Unable to find SPDX provider for '%s'" % name) + if packages: + for name in sorted(packages.keys()): + if name not in providers: + bb.fatal("Unable to find SPDX provider for '%s'" % name) - pkg_name, pkg_hashfn = providers[name] + pkg_name, pkg_hashfn = providers[name] - pkg_spdx_path = oe.sbom.doc_find_by_hashfn(deploy_dir_spdx, package_archs, pkg_name, pkg_hashfn) - if not pkg_spdx_path: - bb.fatal("No SPDX file found for package %s, %s" % (pkg_name, pkg_hashfn)) + pkg_spdx_path = oe.sbom.doc_find_by_hashfn(deploy_dir_spdx, package_archs, pkg_name, pkg_hashfn) + if not pkg_spdx_path: + bb.fatal("No SPDX file found for package %s, %s" % (pkg_name, pkg_hashfn)) - pkg_doc, pkg_doc_sha1 = oe.sbom.read_doc(pkg_spdx_path) + pkg_doc, pkg_doc_sha1 = oe.sbom.read_doc(pkg_spdx_path) - for p in pkg_doc.packages: - if p.name == name: - pkg_ref = oe.spdx.SPDXExternalDocumentRef() - pkg_ref.externalDocumentId = "DocumentRef-%s" % pkg_doc.name - pkg_ref.spdxDocument = pkg_doc.documentNamespace - pkg_ref.checksum.algorithm = "SHA1" - pkg_ref.checksum.checksumValue = pkg_doc_sha1 + for p in pkg_doc.packages: + if p.name == name: + pkg_ref = oe.spdx.SPDXExternalDocumentRef() + pkg_ref.externalDocumentId = "DocumentRef-%s" % pkg_doc.name + pkg_ref.spdxDocument = pkg_doc.documentNamespace + pkg_ref.checksum.algorithm = "SHA1" + pkg_ref.checksum.checksumValue = pkg_doc_sha1 - doc.externalDocumentRefs.append(pkg_ref) - doc.add_relationship(image, "CONTAINS", "%s:%s" % (pkg_ref.externalDocumentId, p.SPDXID)) - break - else: - bb.fatal("Unable to find package with name '%s' in SPDX file %s" % (name, pkg_spdx_path)) - - runtime_spdx_path = oe.sbom.doc_find_by_hashfn(deploy_dir_spdx, package_archs, "runtime-" + name, pkg_hashfn) - if not runtime_spdx_path: - bb.fatal("No runtime SPDX document found for %s, %s" % (name, pkg_hashfn)) - - runtime_doc, runtime_doc_sha1 = oe.sbom.read_doc(runtime_spdx_path) - - runtime_ref = oe.spdx.SPDXExternalDocumentRef() - runtime_ref.externalDocumentId = "DocumentRef-%s" % runtime_doc.name - runtime_ref.spdxDocument = runtime_doc.documentNamespace - runtime_ref.checksum.algorithm = "SHA1" - runtime_ref.checksum.checksumValue = runtime_doc_sha1 - - # "OTHER" isn't ideal here, but I can't find a relationship that makes sense - doc.externalDocumentRefs.append(runtime_ref) - doc.add_relationship( - image, - "OTHER", - "%s:%s" % (runtime_ref.externalDocumentId, runtime_doc.SPDXID), - comment="Runtime dependencies for %s" % name - ) + doc.externalDocumentRefs.append(pkg_ref) + doc.add_relationship(image, "CONTAINS", "%s:%s" % (pkg_ref.externalDocumentId, p.SPDXID)) + break + else: + bb.fatal("Unable to find package with name '%s' in SPDX file %s" % (name, pkg_spdx_path)) + + runtime_spdx_path = oe.sbom.doc_find_by_hashfn(deploy_dir_spdx, package_archs, "runtime-" + name, pkg_hashfn) + if not runtime_spdx_path: + bb.fatal("No runtime SPDX document found for %s, %s" % (name, pkg_hashfn)) + + runtime_doc, runtime_doc_sha1 = oe.sbom.read_doc(runtime_spdx_path) + + runtime_ref = oe.spdx.SPDXExternalDocumentRef() + runtime_ref.externalDocumentId = "DocumentRef-%s" % runtime_doc.name + runtime_ref.spdxDocument = runtime_doc.documentNamespace + runtime_ref.checksum.algorithm = "SHA1" + runtime_ref.checksum.checksumValue = runtime_doc_sha1 + + # "OTHER" isn't ideal here, but I can't find a relationship that makes sense + doc.externalDocumentRefs.append(runtime_ref) + doc.add_relationship( + image, + "OTHER", + "%s:%s" % (runtime_ref.externalDocumentId, runtime_doc.SPDXID), + comment="Runtime dependencies for %s" % name + ) bb.utils.mkdirhier(spdx_workdir) image_spdx_path = spdx_workdir / (rootfs_name + ".spdx.json")
Signature · 1 line
2.43.0
Unfortunately I'm still getting autobuilder errors on the oeeselftest runs, example below:
https://errors.yoctoproject.org/Errors/Details/887588/
Steve
Quoted 99 lines · Kamel Bouhara via lists.openembedded.org
Hello,
This is the v4 series to backport SPDX 3.0 support from upstream Walnascar to Scarthgap (Yocto Project 5.0 LTS).
Changes since v2:
-----------------
Cherry-picked commits:
c5b5136bf8: Excludedo_create_spdxfrom automatic sysroot extension.
03c6ace6c6: FixSPDX_VERSIONhandling in selftests.
7be5a6e699: Add tar test for SPDX 2.2.Local fix:
7e14a5b966: AlignDEPLOY_DIR_SPDXin create-spdx-2.2.bbclass with
${SPDX_VERSION} layout, restoring successful SPDX 2.2 selftests.Changes since v3:
-----------------
Cherry-picked commits:
29d3f8ad4: classes/create-spdx-2.2: Handle empty packagesGreetings,
KamelHongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (11):
classes-global/license: Move functions to library code classes-global/staging: Excludedo_create_spdxfrom automatic sysroot
extension
lib/license: Move package license skip to library
lib: oe: license: Add missing import
classes-recipe/image: Add image file manifest classes-recipe/baremetal-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
oeqa: spdx: Add tar test for SPDX 2.2 classes/create-spdx-2.2: Handle empty packagesKamel Bouhara (Schneider Electric) (4):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_filesclasses/create-spdx-2.2: alignDEPLOY_DIR_SPDXwithSPDX_VERSION
layout
spdx30_tasks: adapt CVE handling to new cve-check APIRichard Purdie (1):
selftest/spdx: Fix forSPDX_VERSIONadditionmeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - meta/classes-global/staging.bbclass | 9 +- meta/classes-recipe/baremetal-image.bbclass | 32 +- .../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-2.2.bbclass | 85 +- 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 | 256 +- 19 files changed, 9348 insertions(+), 264 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 (#226036): https://lists.openembedded.org/g/openembedded-core/message/226036
Mute This Topic: https://lists.openembedded.org/mt/116169967/3620601
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 5 lines · Steve Sakoman
Unfortunately I'm still getting autobuilder errors on the oeeselftest runs, example below:
Is this the correct link? I looked at it an the failure is in devtool with:
Unable to resolve 'mbedtls-2.28' in upstream git repository in git ls-remote output for github.com/ARMmbed/mbedtls.git
Which I don't _think_ should be related to the SPDX changes..... perhaps an unrelated transient error?
Quoted 105 lines
Steve
Quoted 99 lines · Kamel Bouhara via lists.openembedded.org
Hello,
This is the v4 series to backport SPDX 3.0 support from upstream Walnascar to Scarthgap (Yocto Project 5.0 LTS).
Changes since v2:
-----------------
Cherry-picked commits:
c5b5136bf8: Excludedo_create_spdxfrom automatic sysroot extension.
03c6ace6c6: FixSPDX_VERSIONhandling in selftests.
7be5a6e699: Add tar test for SPDX 2.2.Local fix:
7e14a5b966: AlignDEPLOY_DIR_SPDXin create-spdx-2.2.bbclass with
${SPDX_VERSION} layout, restoring successful SPDX 2.2 selftests.Changes since v3:
-----------------
Cherry-picked commits:
29d3f8ad4: classes/create-spdx-2.2: Handle empty packagesGreetings,
KamelHongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (11):
classes-global/license: Move functions to library code classes-global/staging: Excludedo_create_spdxfrom automatic sysroot
extension
lib/license: Move package license skip to library
lib: oe: license: Add missing import
classes-recipe/image: Add image file manifest classes-recipe/baremetal-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
oeqa: spdx: Add tar test for SPDX 2.2 classes/create-spdx-2.2: Handle empty packagesKamel Bouhara (Schneider Electric) (4):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_filesclasses/create-spdx-2.2: alignDEPLOY_DIR_SPDXwithSPDX_VERSION
layout
spdx30_tasks: adapt CVE handling to new cve-check APIRichard Purdie (1):
selftest/spdx: Fix forSPDX_VERSIONadditionmeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - meta/classes-global/staging.bbclass | 9 +- meta/classes-recipe/baremetal-image.bbclass | 32 +- .../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-2.2.bbclass | 85 +- 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 | 256 +- 19 files changed, 9348 insertions(+), 264 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 (#226036): https://lists.openembedded.org/g/openembedded-core/message/226036
Mute This Topic: https://lists.openembedded.org/mt/116169967/3620601
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 8 lines · Joshua Watt
Quoted 5 lines · Steve Sakoman
Unfortunately I'm still getting autobuilder errors on the oeeselftest runs, example below:
Quoted 7 lines
Is this the correct link? I looked at it an the failure is in devtool with:
Unable to resolve 'mbedtls-2.28' in upstream git repository in git ls-remote output for github.com/ARMmbed/mbedtls.git
Which I don't _think_ should be related to the SPDX changes..... perhaps an unrelated transient error?
This is the right link, and you are correct, this does appear to be an unrelated transient issue!
Sorry for the false alarm, this series was the only addition to a previously passing patch set so I jumped to a bad conclusion :-(
Steve
Quoted 102 lines
Quoted 102 lines
Quoted 99 lines · Kamel Bouhara via lists.openembedded.org
Hello,
This is the v4 series to backport SPDX 3.0 support from upstream Walnascar to Scarthgap (Yocto Project 5.0 LTS).
Changes since v2:
-----------------
Cherry-picked commits:
c5b5136bf8: Excludedo_create_spdxfrom automatic sysroot extension.
03c6ace6c6: FixSPDX_VERSIONhandling in selftests.
7be5a6e699: Add tar test for SPDX 2.2.Local fix:
7e14a5b966: AlignDEPLOY_DIR_SPDXin create-spdx-2.2.bbclass with
${SPDX_VERSION} layout, restoring successful SPDX 2.2 selftests.Changes since v3:
-----------------
Cherry-picked commits:
29d3f8ad4: classes/create-spdx-2.2: Handle empty packagesGreetings,
KamelHongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (11):
classes-global/license: Move functions to library code classes-global/staging: Excludedo_create_spdxfrom automatic sysroot
extension
lib/license: Move package license skip to library
lib: oe: license: Add missing import
classes-recipe/image: Add image file manifest classes-recipe/baremetal-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
oeqa: spdx: Add tar test for SPDX 2.2 classes/create-spdx-2.2: Handle empty packagesKamel Bouhara (Schneider Electric) (4):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_filesclasses/create-spdx-2.2: alignDEPLOY_DIR_SPDXwithSPDX_VERSION
layout
spdx30_tasks: adapt CVE handling to new cve-check APIRichard Purdie (1):
selftest/spdx: Fix forSPDX_VERSIONadditionmeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - meta/classes-global/staging.bbclass | 9 +- meta/classes-recipe/baremetal-image.bbclass | 32 +- .../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-2.2.bbclass | 85 +- 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 | 256 +- 19 files changed, 9348 insertions(+), 264 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 (#226036): https://lists.openembedded.org/g/openembedded-core/message/226036
Mute This Topic: https://lists.openembedded.org/mt/116169967/3620601
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 14 lines · Steve Sakoman
Quoted 13 lines · Joshua Watt
Quoted 5 lines · Steve Sakoman
Unfortunately I'm still getting autobuilder errors on the oeeselftest runs, example below:
Is this the correct link? I looked at it an the failure is in devtool with:
Unable to resolve 'mbedtls-2.28' in upstream git repository in git ls-remote output for github.com/ARMmbed/mbedtls.git
Quoted 9 lines
Quoted 2 lines
Which I don't _think_ should be related to the SPDX changes..... perhaps an unrelated transient error?
This is the right link, and you are correct, this does appear to be an unrelated transient issue!
Sorry for the false alarm, this series was the only addition to a previously passing patch set so I jumped to a bad conclusion :-(
Thanks Steve, no worries, glad to hear it was just a transient issue!
Kamel
Quoted 100 lines
Steve
Quoted 90 lines
Quoted 90 lines
Quoted 87 lines · Kamel Bouhara via lists.openembedded.org
Hello,
This is the v4 series to backport SPDX 3.0 support from upstream Walnascar to Scarthgap (Yocto Project 5.0 LTS).
Changes since v2:
-----------------
Cherry-picked commits:
c5b5136bf8: Excludedo_create_spdxfrom automatic sysroot extension.
03c6ace6c6: FixSPDX_VERSIONhandling in selftests.
7be5a6e699: Add tar test for SPDX 2.2.Local fix:
7e14a5b966: AlignDEPLOY_DIR_SPDXin create-spdx-2.2.bbclass with
${SPDX_VERSION} layout, restoring successful SPDX 2.2 selftests.Changes since v3:
-----------------
Cherry-picked commits:
29d3f8ad4: classes/create-spdx-2.2: Handle empty packagesGreetings,
KamelHongxu Jia (1):
oeqa/selftest: Add SPDX 3.0 include source case for work-shareJoshua Watt (11):
classes-global/license: Move functions to library code classes-global/staging: Excludedo_create_spdxfrom automatic sysroot
extension
lib/license: Move package license skip to library
lib: oe: license: Add missing import
classes-recipe/image: Add image file manifest classes-recipe/baremetal-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
oeqa: spdx: Add tar test for SPDX 2.2 classes/create-spdx-2.2: Handle empty packagesKamel Bouhara (Schneider Electric) (4):
backport: SPDX 3.0 fixes and tasks from upstream version Walnascar
spdx30_tasks: fix FetchData attribute inadd_download_filesclasses/create-spdx-2.2: alignDEPLOY_DIR_SPDXwithSPDX_VERSION
layout
spdx30_tasks: adapt CVE handling to new cve-check APIRichard Purdie (1):
selftest/spdx: Fix forSPDX_VERSIONadditionmeta/classes-global/base.bbclass | 41 +- meta/classes-global/license.bbclass | 165 - meta/classes-global/staging.bbclass | 9 +- meta/classes-recipe/baremetal-image.bbclass | 32 +- .../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-2.2.bbclass | 85 +- 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 | 256 +- 19 files changed, 9348 insertions(+), 264 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
Quoted 6 lines
Quoted 6 lines
--
2.43.0
Quoted 8 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#226066): https://lists.openembedded.org/g/openembedded-core/message/226066
Mute This Topic: https://lists.openembedded.org/mt/116169967/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