<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15983</bug_id>
          
          <creation_ts>2025-09-29 10:05:46 +0000</creation_ts>
          <short_desc>No dependency SPDX for non-image recipe with sstate</short_desc>
          <delta_ts>2026-04-09 15:16:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>oe-core other</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gianluca Andreotti">Gianluca.Andreotti</reporter>
          <assigned_to name="Joshua Watt">JPEWhacker</assigned_to>
          <cc>JPEWhacker</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102845</commentid>
    <comment_count>0</comment_count>
    <who name="Gianluca Andreotti">Gianluca.Andreotti</who>
    <bug_when>2025-09-29 10:05:46 +0000</bug_when>
    <thetext>When building a non-image firmware aggregation recipe that pulls in
multiple firmware components as dependencies, SPDX is only generated for
the top-level recipe once dependencies are cached in sstate.

In this case, bitbake -c build &lt;recipe&gt; produces only:

- recipes/recipe-&lt;recipe&gt;.spdx.json
- common_package/&lt;recipe&gt;-package-common.spdx.json
- by-spdxid-hash/ with only two links
 
No SPDX is emitted for dependencies when they are restored from sstate
(subsequent/warm builds).

On a cold build, before sstate is populated, dependency SPDX are
generated as expected.

Workaround:

  bitbake &lt;recipe&gt; --runall do_create_spdx
  bitbake &lt;recipe&gt; --runall do_create_packaged_spdx

This forces SPDX generation across the dependency tree, filling both recipes/
and packages/ directory.

Expected:

SPDX should be generated for the recipe and all of its dependencies,
similar to building an image (e.g. core-image-minimal), without needing
--runall, even when dependencies are retrieved from sstate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102867</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-10-02 14:48:57 +0000</bug_when>
    <thetext>Joshua has a patch to generate the combined SPDX for a single recipe 
rather than an image. This should probably be opt-in rather than default.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102868</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2025-10-02 15:02:53 +0000</bug_when>
    <thetext>Quoting from Josh in private chat:

&quot;Ya that&apos;s expected behavior currently. The package spdx would only be pulled in by an image recipe currently&quot;

Two alternatives:
1) If separated SPDX files are acceptable then --runall is a good workaround, and the missing dependency to ensure that do_build causes do_create_spdx to run recursively is simple.

2) If the actual need is a combined SPDX (as you get with images currently), then Josh does have some WIP to allow this to happen for any recipe, not just images.

Gianluca: are individual SPDX files acceptable, or would you prefer a combined SPDX?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102879</commentid>
    <comment_count>3</comment_count>
    <who name="Gianluca Andreotti">Gianluca.Andreotti</who>
    <bug_when>2025-10-02 16:38:45 +0000</bug_when>
    <thetext>&gt; Gianluca: are individual SPDX files acceptable, or would you prefer a combined SPDX?

A combined SPDX would be preferable.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>