<?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>14893</bug_id>
          
          <creation_ts>2022-08-17 12:09:20 +0000</creation_ts>
          <short_desc>Non-deterministic Metadata for SDK build</short_desc>
          <delta_ts>2022-12-22 16:44:24 +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>core</component>
          <version>3.1.14</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Frieder Schrempf">frieder.schrempf</reporter>
          <assigned_to name="Sakib Sajal">sakib.sajal</assigned_to>
          <cc>frieder.schrempf</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</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>93821</commentid>
    <comment_count>0</comment_count>
    <who name="Frieder Schrempf">frieder.schrempf</who>
    <bug_when>2022-08-17 12:09:20 +0000</bug_when>
    <thetext>Doing the following:

```
bitbake -c cleansstate meta-environment-&lt;machine&gt;
bitbake -c populate_sdk core-image-minimal
```

results in:

```
ERROR: When reparsing /yocto-ktn/build-sp5/../layers/poky/meta/recipes-core/meta/meta-environment.bb:do_generate_content, the basehash value changed from f8e0d4bacfb2940c49542bf6b72b81fa06f96746fa1f4acb58a56c4b28a766da to 2bd1f3bb9789d9d2330e546d0678ae875882376905b00de4d4661ec2c935eb27. The metadata is not deterministic and this needs to be fixed.
ERROR: The following commands may help:
ERROR: $ bitbake meta-environment-imx8mm-sp5 -cdo_generate_content -Snone
ERROR: Then:
ERROR: $ bitbake meta-environment-imx8mm-sp5 -cdo_generate_content -Sprintdiff
```

Debugging leads to the variable METADATA_REVISION in meta/classes/toolchain-scripts-base.bbclass changing from the git commit hash of the poky repo to &lt;unknown&gt;.

The following change seems to fix the issue, but I&apos;m not sure if it&apos;s a valid fix. Maybe some other fix is needed to avoid having METADATA_REVISION change in the first place!?


```diff
--- a/meta/classes/toolchain-scripts-base.bbclass
+++ b/meta/classes/toolchain-scripts-base.bbclass
@@ -8,4 +8,4 @@ toolchain_create_sdk_version () {
        echo &apos;Metadata Revision: ${METADATA_REVISION}&apos; &gt;&gt; $versionfile
        echo &apos;Timestamp: ${DATETIME}&apos; &gt;&gt; $versionfile
 }
-toolchain_create_sdk_version[vardepsexclude] = &quot;DATETIME&quot;
+toolchain_create_sdk_version[vardepsexclude] = &quot;DATETIME METADATA_REVISION&quot;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93847</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-08-18 14:50:11 +0000</bug_when>
    <thetext>Sakib, Check if this is reproducible.
If it&apos;s not (as we suspect), we&apos;ll need more info about how to reproduce the issue.

YP Triage</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93857</commentid>
    <comment_count>2</comment_count>
    <who name="Sakib Sajal">sakib.sajal</who>
    <bug_when>2022-08-18 18:04:13 +0000</bug_when>
    <thetext>I was unable to reproduce the issue, steps provided below.
using poky at:
    commit 7e10918724646a86afd4739ea136dac63d22def3 (HEAD -&gt; master, origin/master, origin/HEAD)
    Author: Khem Raj &lt;raj.khem@gmail.com&gt;
    Date:   Tue Aug 16 09:58:56 2022 -0700

Steps:
# setup build dir
bitbake core-image-minimal
bitbake -c cleansstate meta-environment-qemux86-64
bitbake -c populate_sdk core-image-minimal

All the above steps completed without warnings/errors.

Am I missing something?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93886</commentid>
    <comment_count>3</comment_count>
    <who name="Frieder Schrempf">frieder.schrempf</who>
    <bug_when>2022-08-24 08:13:02 +0000</bug_when>
    <thetext>Ok, I did some more tests and so far I can only reproduce it on 3.1.14 which is outdated. On the recent Dunfell HEAD (3.1.19) I didn&apos;t see the issue anymore, so I assume it was fixed somewhere.

I guess you can safely close this report and sorry for the noise!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94592</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-12-22 16:44:24 +0000</bug_when>
    <thetext>Works on supported branches.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>