diff options
author | Mark Hatle <mark.hatle@amd.com> | 2024-07-24 18:39:18 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-07-26 12:28:42 +0100 |
commit | edc44fcf135d13e6c514c329ad4d0538ef8faf77 (patch) | |
tree | 9c39c7d0230ee50758dd8fbcd25926c10400ca1d /meta/classes/create-spdx-2.2.bbclass | |
parent | 0328f2a585be350eee229dc05c0ed8163b61b47c (diff) | |
download | poky-edc44fcf135d13e6c514c329ad4d0538ef8faf77.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: f1499c36c1054fc90f7b7268cc95285f2eca72f7)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/create-spdx-2.2.bbclass')
-rw-r--r-- | meta/classes/create-spdx-2.2.bbclass | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass index 12b78cb3f6..509d3b58b6 100644 --- a/meta/classes/create-spdx-2.2.bbclass +++ b/meta/classes/create-spdx-2.2.bbclass | |||
@@ -267,7 +267,7 @@ def collect_dep_recipes(d, doc, spdx_recipe): | |||
267 | import oe.spdx_common | 267 | import oe.spdx_common |
268 | 268 | ||
269 | deploy_dir_spdx = Path(d.getVar("DEPLOY_DIR_SPDX")) | 269 | deploy_dir_spdx = Path(d.getVar("DEPLOY_DIR_SPDX")) |
270 | package_archs = d.getVar("SSTATE_ARCHS").split() | 270 | package_archs = d.getVar("SPDX_MULTILIB_SSTATE_ARCHS").split() |
271 | package_archs.reverse() | 271 | package_archs.reverse() |
272 | 272 | ||
273 | dep_recipes = [] | 273 | dep_recipes = [] |
@@ -312,7 +312,7 @@ def collect_dep_recipes(d, doc, spdx_recipe): | |||
312 | 312 | ||
313 | return dep_recipes | 313 | return dep_recipes |
314 | 314 | ||
315 | collect_dep_recipes[vardepsexclude] = "SSTATE_ARCHS" | 315 | collect_dep_recipes[vardepsexclude] = "SPDX_MULTILIB_SSTATE_ARCHS" |
316 | 316 | ||
317 | def collect_dep_sources(d, dep_recipes): | 317 | def collect_dep_sources(d, dep_recipes): |
318 | import oe.sbom | 318 | import oe.sbom |
@@ -610,7 +610,7 @@ python do_create_runtime_spdx() { | |||
610 | 610 | ||
611 | providers = oe.spdx_common.collect_package_providers(d) | 611 | providers = oe.spdx_common.collect_package_providers(d) |
612 | pkg_arch = d.getVar("SSTATE_PKGARCH") | 612 | pkg_arch = d.getVar("SSTATE_PKGARCH") |
613 | package_archs = d.getVar("SSTATE_ARCHS").split() | 613 | package_archs = d.getVar("SPDX_MULTILIB_SSTATE_ARCHS").split() |
614 | package_archs.reverse() | 614 | package_archs.reverse() |
615 | 615 | ||
616 | if not is_native: | 616 | if not is_native: |
@@ -716,7 +716,7 @@ python do_create_runtime_spdx() { | |||
716 | oe.sbom.write_doc(d, runtime_doc, pkg_arch, "runtime", spdx_deploy, indent=get_json_indent(d)) | 716 | oe.sbom.write_doc(d, runtime_doc, pkg_arch, "runtime", spdx_deploy, indent=get_json_indent(d)) |
717 | } | 717 | } |
718 | 718 | ||
719 | do_create_runtime_spdx[vardepsexclude] += "OVERRIDES SSTATE_ARCHS" | 719 | do_create_runtime_spdx[vardepsexclude] += "OVERRIDES SPDX_MULTILIB_SSTATE_ARCHS" |
720 | 720 | ||
721 | addtask do_create_runtime_spdx after do_create_spdx before do_build do_rm_work | 721 | addtask do_create_runtime_spdx after do_create_spdx before do_build do_rm_work |
722 | SSTATETASKS += "do_create_runtime_spdx" | 722 | SSTATETASKS += "do_create_runtime_spdx" |
@@ -798,7 +798,7 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages, spdx | |||
798 | import bb.compress.zstd | 798 | import bb.compress.zstd |
799 | 799 | ||
800 | providers = oe.spdx_common.collect_package_providers(d) | 800 | providers = oe.spdx_common.collect_package_providers(d) |
801 | package_archs = d.getVar("SSTATE_ARCHS").split() | 801 | package_archs = d.getVar("SPDX_MULTILIB_SSTATE_ARCHS").split() |
802 | package_archs.reverse() | 802 | package_archs.reverse() |
803 | 803 | ||
804 | creation_time = datetime.now(tz=timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ") | 804 | creation_time = datetime.now(tz=timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ") |
@@ -950,4 +950,4 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages, spdx | |||
950 | 950 | ||
951 | tar.addfile(info, fileobj=index_str) | 951 | tar.addfile(info, fileobj=index_str) |
952 | 952 | ||
953 | combine_spdx[vardepsexclude] += "BB_NUMBER_THREADS SSTATE_ARCHS" | 953 | combine_spdx[vardepsexclude] += "BB_NUMBER_THREADS SPDX_MULTILIB_SSTATE_ARCHS" |