@@ -330,13 +330,14 @@ def collect_dep_objsets(d, direct_deps, subdir, fn_prefix, obj_type, **attr_filt
dep_obj, dep_objset = oe.sbom30.find_root_obj_in_jsonld(
d, subdir, fn_prefix + dep.pn, obj_type, **attr_filter
)
- # If the dependency is part of the taskhash, return it to be linked
- # against. Otherwise, it cannot be linked against because this recipe
- # will not rebuilt if dependency changes
- if dep.in_taskhash:
- dep_objsets.append(dep_objset)
+ # If the dependency is not part of the task hash, do not include it
+ # since the dependency may not be present in subsequent runs, and may
+ # not rebuild if it changes
+ if not dep.in_taskhash:
+ bb.debug(1, f"Skipping dependency {dep.pn} (not in taskhash)")
+ continue
- # The object _can_ be linked against (by alias)
+ dep_objsets.append(dep_objset)
dep_objs.add(dep_obj)
return dep_objsets, dep_objs
If a dependency is not in the taskhash, it cannot be included in the SPDX data because the dependency may not trigger the recipe to rebuild if it changes (although aliases help with this), but more importantly bitbake may not restore the sstate object associated with the dependency which causes errors when constructing the final SBoM Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> --- meta/lib/oe/spdx30_tasks.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)