[OE-core][PATCH v6 00/12] Add SPDX 3.0 support

Joshua Watt
2024-07-12T16:03:33Z

This patch series add support for SPDX 3.0 and sets it as the default.
Currently it is not possible to have SPDX 2.2 and SPDX 3.0 enabled at
the same time

v2: Added tests and addressed feedback
v3: Fixed several oe-selftest and build failures
v4: Fixed silly typo mistake in staging.bbclass
v5: Reworked to make SPDX 3 output reproducible by default. Variables
that introduce non-reproducible output are documented as such.
v6: Many changes:
* Fixed bug where building baremetal images would break SPDX 2.2
* Most SPDX code is now in python library files instead of tasks
* Removed dependency on pacakge_write_* tasks
* Fixed sstate selftest cases to account for SPDX 3.0 task names

Joshua Watt (12):
classes-recipe/image: Add image file manifest
classes-recipe/baremetal-image: Add image file manifest
classes/create-spdx-3.0: Add classes
classes-global/staging: Exclude do_create_spdx from automatic sysroot
extension
classes-recipe/image_types: Add SPDX_IMAGE_PURPOSE to images
selftest: spdx: Add SPDX 3.0 test cases
classes-recipe: nospdx: Add class
selftest: sstatetests: Exclude all SPDX tasks
classes/spdx-common: Move to library
classes/create-spdx-3.0: Move tasks to library
classes/create-spdx-2.2: Handle empty packages
Switch default spdx version to 3.0

meta/classes-global/staging.bbclass | 9 +-
meta/classes-recipe/baremetal-image.bbclass | 32 +-
meta/classes-recipe/image.bbclass | 58 +
meta/classes-recipe/image_types.bbclass | 2 +
meta/classes-recipe/image_types_wic.bbclass | 1 +
meta/classes-recipe/nospdx.bbclass | 13 +
meta/classes-recipe/packagegroup.bbclass | 2 +
meta/classes/create-spdx-2.2.bbclass | 106 +-
meta/classes/create-spdx-3.0.bbclass | 191 +
meta/classes/create-spdx-image-3.0.bbclass | 145 +
meta/classes/create-spdx.bbclass | 2 +-
meta/classes/spdx-common.bbclass | 195 +-
meta/lib/oe/sbom30.py | 1121 ++++
meta/lib/oe/spdx30.py | 6020 ++++++++++++++++++
meta/lib/oe/spdx30_tasks.py | 1229 ++++
meta/lib/oe/spdx_common.py | 228 +
meta/lib/oeqa/selftest/cases/spdx.py | 133 +-
meta/lib/oeqa/selftest/cases/sstatetests.py | 3 +-
meta/recipes-core/meta/build-sysroots.bb | 5 +-
meta/recipes-core/meta/meta-world-pkgdata.bb | 3 +-
20 files changed, 9243 insertions(+), 255 deletions(-)
create mode 100644 meta/classes-recipe/nospdx.bbclass
create mode 100644 meta/classes/create-spdx-3.0.bbclass
create mode 100644 meta/classes/create-spdx-image-3.0.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.45.2