diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2024-11-22 08:49:39 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-11-23 14:44:54 +0000 |
commit | 9ca371643776d1b4d9b3beae79482ba6be7618a9 (patch) | |
tree | e5d2827c852e1f11f0057f4eddf4dac6c29600a9 /meta/classes | |
parent | db4bdba2fd3cd5453e11d4cb7d25b01980f6962c (diff) | |
download | poky-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.bbclass | 9 |
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 | |||
122 | oe.spdx30_tasks.collect_dep_objsets[vardepsexclude] = "SPDX_MULTILIB_SSTATE_ARCHS" | 122 | oe.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. | ||
128 | SPDX3_LIB_DEP_FILES = "\ | ||
129 | ${COREBASE}/meta/lib/oe/sbom30.py:True \ | ||
130 | ${COREBASE}/meta/lib/oe/spdx30.py:True \ | ||
131 | " | ||
125 | 132 | ||
126 | python do_create_spdx() { | 133 | python do_create_spdx() { |
127 | import oe.spdx30_tasks | 134 | import oe.spdx30_tasks |
@@ -137,6 +144,7 @@ addtask do_create_spdx after \ | |||
137 | SSTATETASKS += "do_create_spdx" | 144 | SSTATETASKS += "do_create_spdx" |
138 | do_create_spdx[sstate-inputdirs] = "${SPDXDEPLOY}" | 145 | do_create_spdx[sstate-inputdirs] = "${SPDXDEPLOY}" |
139 | do_create_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}" | 146 | do_create_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}" |
147 | do_create_spdx[file-checksums] += "${SPDX3_LIB_DEP_FILES}" | ||
140 | 148 | ||
141 | python do_create_spdx_setscene () { | 149 | python 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 | |||
160 | SSTATETASKS += "do_create_package_spdx" | 168 | SSTATETASKS += "do_create_package_spdx" |
161 | do_create_package_spdx[sstate-inputdirs] = "${SPDXRUNTIMEDEPLOY}" | 169 | do_create_package_spdx[sstate-inputdirs] = "${SPDXRUNTIMEDEPLOY}" |
162 | do_create_package_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}" | 170 | do_create_package_spdx[sstate-outputdirs] = "${DEPLOY_DIR_SPDX}" |
171 | do_create_package_spdx[file-checksums] += "${SPDX3_LIB_DEP_FILES}" | ||
163 | 172 | ||
164 | python do_create_package_spdx_setscene () { | 173 | python do_create_package_spdx_setscene () { |
165 | sstate_setscene(d) | 174 | sstate_setscene(d) |