diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2024-07-26 11:22:34 -0500 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-08-06 19:11:18 -0700 |
| commit | 86324b2306828d7aeef7373fa62c42e118091c1c (patch) | |
| tree | 68a548d63b42d8b152aa9954922901172fc3ae06 | |
| parent | c80d82054e9c34305d3372b9c644b147187b36e9 (diff) | |
| download | poky-86324b2306828d7aeef7373fa62c42e118091c1c.tar.gz | |
create-spdx-*: Support multilibs via SPDX_MULTILIB_SSTATE_ARCHS
When a create-spdx-* classes is processing documents, it needs to
find the document in a path that is related to the SSTATE_ARCH
when a packge is generated. The SSTATE_ARCH can be affected by
multilib configurations, resulting is something like armv8a-mlib.
When the image (or SDK) is being generated and the components are
collected, the system has no knowledge of the multilib arch and
will fail to find it, such as:
ERROR: meta-toolchain-1.0-r0 do_populate_sdk: No SPDX file found
for package libilp32-libgcc-dbg,
False sstate:libilp32-libgcc:armv8a-ilp32-mllibilp32-elf:14.1.0:r0:armv8a-ilp32:12:
sstate:libilp32-libgcc::14.1.0:r0::12:
Adding in the new SPDX_MULTILIB_SSTATE_ARCHS will provide a full
set of SSTATE_ARCHS including ones that contain the multilib
extension which will allow create-spdx-* to correctly find the
document it is looking for. This would also be valuable to any
other function doing a similar search through SSTATE_ARCH that may
have been extended with multilib configurations.
(From OE-Core rev: 5c1ce317fff6df6818f72d93197e5ec59ad4c462)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f1499c36c1054fc90f7b7268cc95285f2eca72f7)
spdx-3.0 items are not application and were removed.
spdx-common.bbclass item was moved into create-sdpx-2.2.bbclass.
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/classes-recipe/populate_sdk_base.bbclass | 4 | ||||
| -rw-r--r-- | meta/classes/create-spdx-2.2.bbclass | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass index 81896d808f..6cb43ade30 100644 --- a/meta/classes-recipe/populate_sdk_base.bbclass +++ b/meta/classes-recipe/populate_sdk_base.bbclass | |||
| @@ -6,6 +6,10 @@ | |||
| 6 | 6 | ||
| 7 | PACKAGES = "" | 7 | PACKAGES = "" |
| 8 | 8 | ||
| 9 | # This exists as an optimization for SPDX processing to only run in image and | ||
| 10 | # SDK processing context. This class happens to be common to these usages. | ||
| 11 | SPDX_MULTILIB_SSTATE_ARCHS = "${@all_multilib_tune_values(d, 'SSTATE_ARCHS')}" | ||
| 12 | |||
| 9 | inherit image-postinst-intercepts image-artifact-names | 13 | inherit image-postinst-intercepts image-artifact-names |
| 10 | 14 | ||
| 11 | # Wildcards specifying complementary packages to install for every package that has been explicitly | 15 | # Wildcards specifying complementary packages to install for every package that has been explicitly |
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass index 4ea91f6499..d104668ffd 100644 --- a/meta/classes/create-spdx-2.2.bbclass +++ b/meta/classes/create-spdx-2.2.bbclass | |||
| @@ -35,6 +35,8 @@ SPDX_LICENSES ??= "${COREBASE}/meta/files/spdx-licenses.json" | |||
| 35 | 35 | ||
| 36 | SPDX_CUSTOM_ANNOTATION_VARS ??= "" | 36 | SPDX_CUSTOM_ANNOTATION_VARS ??= "" |
| 37 | 37 | ||
| 38 | SPDX_MULTILIB_SSTATE_ARCHS ??= "${SSTATE_ARCHS}" | ||
| 39 | |||
| 38 | SPDX_ORG ??= "OpenEmbedded ()" | 40 | SPDX_ORG ??= "OpenEmbedded ()" |
| 39 | SPDX_SUPPLIER ??= "Organization: ${SPDX_ORG}" | 41 | SPDX_SUPPLIER ??= "Organization: ${SPDX_ORG}" |
| 40 | SPDX_SUPPLIER[doc] = "The SPDX PackageSupplier field for SPDX packages created from \ | 42 | SPDX_SUPPLIER[doc] = "The SPDX PackageSupplier field for SPDX packages created from \ |
| @@ -349,7 +351,7 @@ def collect_dep_recipes(d, doc, spdx_recipe): | |||
| 349 | 351 | ||
| 350 | deploy_dir_spdx = Path(d.getVar("DEPLOY_DIR_SPDX")) | 352 | deploy_dir_spdx = Path(d.getVar("DEPLOY_DIR_SPDX")) |
| 351 | spdx_deps_file = Path(d.getVar("SPDXDEPS")) | 353 | spdx_deps_file = Path(d.getVar("SPDXDEPS")) |
| 352 | package_archs = d.getVar("SSTATE_ARCHS").split() | 354 | package_archs = d.getVar("SPDX_MULTILIB_SSTATE_ARCHS").split() |
| 353 | package_archs.reverse() | 355 | package_archs.reverse() |
| 354 | 356 | ||
| 355 | dep_recipes = [] | 357 | dep_recipes = [] |
| @@ -389,7 +391,7 @@ def collect_dep_recipes(d, doc, spdx_recipe): | |||
| 389 | 391 | ||
| 390 | return dep_recipes | 392 | return dep_recipes |
| 391 | 393 | ||
| 392 | collect_dep_recipes[vardepsexclude] = "SSTATE_ARCHS" | 394 | collect_dep_recipes[vardepsexclude] = "SPDX_MULTILIB_SSTATE_ARCHS" |
| 393 | 395 | ||
| 394 | def collect_dep_sources(d, dep_recipes): | 396 | def collect_dep_sources(d, dep_recipes): |
| 395 | import oe.sbom | 397 | import oe.sbom |
| @@ -763,7 +765,7 @@ python do_create_runtime_spdx() { | |||
| 763 | 765 | ||
| 764 | providers = collect_package_providers(d) | 766 | providers = collect_package_providers(d) |
| 765 | pkg_arch = d.getVar("SSTATE_PKGARCH") | 767 | pkg_arch = d.getVar("SSTATE_PKGARCH") |
| 766 | package_archs = d.getVar("SSTATE_ARCHS").split() | 768 | package_archs = d.getVar("SPDX_MULTILIB_SSTATE_ARCHS").split() |
| 767 | package_archs.reverse() | 769 | package_archs.reverse() |
| 768 | 770 | ||
| 769 | if not is_native: | 771 | if not is_native: |
| @@ -869,7 +871,7 @@ python do_create_runtime_spdx() { | |||
| 869 | oe.sbom.write_doc(d, runtime_doc, pkg_arch, "runtime", spdx_deploy, indent=get_json_indent(d)) | 871 | oe.sbom.write_doc(d, runtime_doc, pkg_arch, "runtime", spdx_deploy, indent=get_json_indent(d)) |
| 870 | } | 872 | } |
| 871 | 873 | ||
| 872 | do_create_runtime_spdx[vardepsexclude] += "OVERRIDES SSTATE_ARCHS" | 874 | do_create_runtime_spdx[vardepsexclude] += "OVERRIDES SPDX_MULTILIB_SSTATE_ARCHS" |
| 873 | 875 | ||
| 874 | addtask do_create_runtime_spdx after do_create_spdx before do_build do_rm_work | 876 | addtask do_create_runtime_spdx after do_create_spdx before do_build do_rm_work |
| 875 | SSTATETASKS += "do_create_runtime_spdx" | 877 | SSTATETASKS += "do_create_runtime_spdx" |
| @@ -1004,7 +1006,7 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages, spdx | |||
| 1004 | import bb.compress.zstd | 1006 | import bb.compress.zstd |
| 1005 | 1007 | ||
| 1006 | providers = collect_package_providers(d) | 1008 | providers = collect_package_providers(d) |
| 1007 | package_archs = d.getVar("SSTATE_ARCHS").split() | 1009 | package_archs = d.getVar("SPDX_MULTILIB_SSTATE_ARCHS").split() |
| 1008 | package_archs.reverse() | 1010 | package_archs.reverse() |
| 1009 | 1011 | ||
| 1010 | creation_time = datetime.now(tz=timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ") | 1012 | creation_time = datetime.now(tz=timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ") |
| @@ -1155,4 +1157,4 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages, spdx | |||
| 1155 | 1157 | ||
| 1156 | tar.addfile(info, fileobj=index_str) | 1158 | tar.addfile(info, fileobj=index_str) |
| 1157 | 1159 | ||
| 1158 | combine_spdx[vardepsexclude] += "BB_NUMBER_THREADS SSTATE_ARCHS" | 1160 | combine_spdx[vardepsexclude] += "BB_NUMBER_THREADS SPDX_MULTILIB_SSTATE_ARCHS" |
