mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

The SPDX code makes heavy use of python classes. While this works very well, the bitbake dependency parser is unable to understand how to deal with them, and thus changes to the class code do not cause rebuilds to occur. To correct this, add the library files that include SPDX code as file checksums for the SPDX tasks. If this method works well for SPDX, we will look at implementing something similar in the bitbake dependency parser that should allow correct checksums without having to explicitly add them to each class. (From OE-Core rev: 6ac3033b77a0d1f7ab15801c5c65931adede3923) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
75 lines
2.5 KiB
Plaintext
75 lines
2.5 KiB
Plaintext
#
|
|
# Copyright OpenEmbedded Contributors
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
#
|
|
# SPDX SDK tasks
|
|
|
|
do_populate_sdk[recrdeptask] += "do_create_spdx do_create_package_spdx"
|
|
do_populate_sdk[cleandirs] += "${SPDXSDKWORK}"
|
|
do_populate_sdk[postfuncs] += "sdk_create_sbom"
|
|
do_populate_sdk[file-checksums] += "${SPDX3_LIB_DEP_FILES}"
|
|
POPULATE_SDK_POST_HOST_COMMAND:append:task-populate-sdk = " sdk_host_create_spdx"
|
|
POPULATE_SDK_POST_TARGET_COMMAND:append:task-populate-sdk = " sdk_target_create_spdx"
|
|
|
|
do_populate_sdk_ext[recrdeptask] += "do_create_spdx do_create_package_spdx"
|
|
do_populate_sdk_ext[cleandirs] += "${SPDXSDKEXTWORK}"
|
|
do_populate_sdk_ext[postfuncs] += "sdk_ext_create_sbom"
|
|
do_populate_sdk_ext[file-checksums] += "${SPDX3_LIB_DEP_FILES}"
|
|
POPULATE_SDK_POST_HOST_COMMAND:append:task-populate-sdk-ext = " sdk_ext_host_create_spdx"
|
|
POPULATE_SDK_POST_TARGET_COMMAND:append:task-populate-sdk-ext = " sdk_ext_target_create_spdx"
|
|
|
|
python sdk_host_create_spdx() {
|
|
from pathlib import Path
|
|
import oe.spdx30_tasks
|
|
spdx_work_dir = Path(d.getVar('SPDXSDKWORK'))
|
|
|
|
oe.spdx30_tasks.sdk_create_spdx(d, "host", spdx_work_dir, d.getVar("TOOLCHAIN_OUTPUTNAME"))
|
|
}
|
|
|
|
python sdk_target_create_spdx() {
|
|
from pathlib import Path
|
|
import oe.spdx30_tasks
|
|
spdx_work_dir = Path(d.getVar('SPDXSDKWORK'))
|
|
|
|
oe.spdx30_tasks.sdk_create_spdx(d, "target", spdx_work_dir, d.getVar("TOOLCHAIN_OUTPUTNAME"))
|
|
}
|
|
|
|
python sdk_ext_host_create_spdx() {
|
|
from pathlib import Path
|
|
import oe.spdx30_tasks
|
|
spdx_work_dir = Path(d.getVar('SPDXSDKEXTWORK'))
|
|
|
|
# TODO: This doesn't seem to work
|
|
oe.spdx30_tasks.sdk_create_spdx(d, "host", spdx_work_dir, d.getVar("TOOLCHAINEXT_OUTPUTNAME"))
|
|
}
|
|
|
|
python sdk_ext_target_create_spdx() {
|
|
from pathlib import Path
|
|
import oe.spdx30_tasks
|
|
spdx_work_dir = Path(d.getVar('SPDXSDKEXTWORK'))
|
|
|
|
# TODO: This doesn't seem to work
|
|
oe.spdx30_tasks.sdk_create_spdx(d, "target", spdx_work_dir, d.getVar("TOOLCHAINEXT_OUTPUTNAME"))
|
|
}
|
|
|
|
|
|
python sdk_create_sbom() {
|
|
from pathlib import Path
|
|
import oe.spdx30_tasks
|
|
sdk_deploydir = Path(d.getVar("SDKDEPLOYDIR"))
|
|
spdx_work_dir = Path(d.getVar('SPDXSDKWORK'))
|
|
|
|
oe.spdx30_tasks.create_sdk_sbom(d, sdk_deploydir, spdx_work_dir, d.getVar("TOOLCHAIN_OUTPUTNAME"))
|
|
}
|
|
|
|
python sdk_ext_create_sbom() {
|
|
from pathlib import Path
|
|
import oe.spdx30_tasks
|
|
sdk_deploydir = Path(d.getVar("SDKEXTDEPLOYDIR"))
|
|
spdx_work_dir = Path(d.getVar('SPDXSDKEXTWORK'))
|
|
|
|
oe.spdx30_tasks.create_sdk_sbom(d, sdk_deploydir, spdx_work_dir, d.getVar("TOOLCHAINEXT_OUTPUTNAME"))
|
|
}
|
|
|