<?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>14344</bug_id>
          
          <creation_ts>2021-04-14 15:04:27 +0000</creation_ts>
          <short_desc>bitbake/OE &quot;latches&quot; sstate even with taskdep changes</short_desc>
          <delta_ts>2021-04-15 14:37:27 +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>kernel</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>jandryuk</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>randy.macleod</cc>
    
    <cc>tom.zanussi</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>89928</commentid>
    <comment_count>0</comment_count>
    <who name="">jandryuk</who>
    <bug_when>2021-04-14 15:04:27 +0000</bug_when>
    <thetext>Does OE/Bitbake &quot;latch&quot; its decision to use sstate and not re-evaluate if the dependent taskdeps change?

We have builds using sstate, externalsrc and rm_work.  We build signed kernel modules letting Linux auto generate a key.  This key is stored in STAGING_KERNEL_BUILDDIR via do_shared_workdir and it is used to sign out-of-tree, externalsrc modules.

Sometimes the externalsrc modules are rebuilt and don&apos;t have a matching key, so they cannot load.

The scenario seems to be:
virtual/kernel (linux-openxt) is selected from sstate
argo-module needs to be rebuilt since exernalsrc and MACHINE changed
argo-module -&gt; depends on make-mod-scripts -&gt; virtual/kernel:do_shared_workdir -&gt; virtual/kernel:do_compile

The kernel recompiles and generates a new signing key, which is used for argo-module.  However, the newly re-compiled kernel is not packaged, so the old one from sstate is re-used.  This leads to the signature mismatch.

We added the following to linux-openxt to (try to) prevent such a scenario:
def get_signing_key(d):
    path = os.path.join(d.getVar(&quot;B&quot;),&quot;certs&quot;,&quot;signing_key.x509&quot;)
    return path + &quot;:&quot; + str(os.path.exists(path))

do_shared_workdir[file-checksums] = &quot;${@get_signing_key(d)}&quot;

However, the OE/bitbake decision to use sstate for virtual/kernel seems to be &quot;latched&quot; early on and not re-evaluated even though the task hashes for virtual/kernel changed.  Is this expected?

Thanks,
Jason</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89952</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-04-15 14:37:27 +0000</bug_when>
    <thetext>We have to resolve task hashes in advance of builds, ie. at parse time.
So we don&apos;t support changing task hashes part way through the build.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>