summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2024-11-22 08:49:39 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-11-23 14:44:54 +0000
commit9ca371643776d1b4d9b3beae79482ba6be7618a9 (patch)
treee5d2827c852e1f11f0057f4eddf4dac6c29600a9 /meta/classes
parentdb4bdba2fd3cd5453e11d4cb7d25b01980f6962c (diff)
downloadpoky-9ca371643776d1b4d9b3beae79482ba6be7618a9.tar.gz
spdx: Fix SPDX tasks not running when code changes
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>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/create-spdx-3.0.bbclass9
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/classes/create-spdx-3.0.bbclass b/meta/classes/create-spdx-3.0.bbclass
index bc23d2d211..640f5490bd 100644
--- a/meta/classes/create-spdx-3.0.bbclass
+++ b/meta/classes/create-spdx-3.0.bbclass
@@ -122,6 +122,13 @@ oe.spdx30_tasks.get_package_sources_from_debug[vardepsexclude] += "STAGING_KERNE
122oe.spdx30_tasks.collect_dep_objsets[vardepsexclude] = "SPDX_MULTILIB_SSTATE_ARCHS" 122oe.spdx30_tasks.collect_dep_objsets[vardepsexclude] = "SPDX_MULTILIB_SSTATE_ARCHS"
123 123
124 124
125# SPDX library code makes heavy use of classes, which bitbake cannot easily
126# parse out dependencies. As such, the library code files that make use of
127# classes are explicitly added as file checksum dependencies.
128SPDX3_LIB_DEP_FILES = "\
129 ${COREBASE}/meta/lib/oe/sbom30.py:True \
130 ${COREBASE}/meta/lib/oe/spdx30.py:True \
131 "
125 132
126python do_create_spdx() { 133python do_create_spdx() {
127 import oe.spdx30_tasks 134 import oe.spdx30_tasks
@@ -137,6 +144,7 @@ addtask do_create_spdx after \
137SSTATETASKS += "do_create_spdx" 144SSTATETASKS += "do_create_spdx"
138do_create_spdx[sstate-inputdirs] = "${SPDXDEPLOY}" 145do_create_spdx[sstate-inputdirs] = "${SPDXDEPLOY}"
139do_create_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}" 146do_create_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}"
147do_create_spdx[file-checksums] += "${SPDX3_LIB_DEP_FILES}"
140 148
141python do_create_spdx_setscene () { 149python do_create_spdx_setscene () {
142 sstate_setscene(d) 150 sstate_setscene(d)
@@ -160,6 +168,7 @@ addtask do_create_package_spdx after do_create_spdx before do_build do_rm_work
160SSTATETASKS += "do_create_package_spdx" 168SSTATETASKS += "do_create_package_spdx"
161do_create_package_spdx[sstate-inputdirs] = "${SPDXRUNTIMEDEPLOY}" 169do_create_package_spdx[sstate-inputdirs] = "${SPDXRUNTIMEDEPLOY}"
162do_create_package_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}" 170do_create_package_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}"
171do_create_package_spdx[file-checksums] += "${SPDX3_LIB_DEP_FILES}"
163 172
164python do_create_package_spdx_setscene () { 173python do_create_package_spdx_setscene () {
165 sstate_setscene(d) 174 sstate_setscene(d)