<?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>14965</bug_id>
          
          <creation_ts>2022-11-08 14:01:58 +0000</creation_ts>
          <short_desc>rust rebuilds not always clean</short_desc>
          <delta_ts>2026-05-28 14:08:04 +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>devtools / tool chain</component>
          <version>0.0.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>ACCEPTED</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.1 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Sundeep Kokkonda">sundeep.kokkonda</assigned_to>
          <cc>alex.kiernan</cc>
    
    <cc>deepadeepthi98</cc>
    
    <cc>ecordonnier</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>Naveen.Gowda</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>sundeep.kokkonda</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>94378</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-11-08 14:01:58 +0000</bug_when>
    <thetext>I have a build directory I&apos;ve reused heavily. After the rust 163-&gt;1.64 upgrade, I&apos;m seeing librsvg compile failures which are long lists of errors but boils down to:

| error[E0464]: multiple matching crates for `core`
|   |
|   = note: candidates:
|           crate `core`: /media/build1/poky/build/tmp/work/core2-64-poky-linux/librsvg/2.54.5-r0/recipe-sysroot/usr/lib/rustlib/x86_64-poky-linux-gnu/lib/libcore-5c7322bf8f654199.rmeta
|           crate `core`: /media/build1/poky/build/tmp/work/core2-64-poky-linux/librsvg/2.54.5-r0/recipe-sysroot/usr/lib/rustlib/x86_64-poky-linux-gnu/lib/libcore-c5fc82c620226960.rmeta

i.e. there are two copies of core and rust isn&apos;t happy about it.

These are both listed in manifest-core2-64-libstd-rs.populate_sysroot in sstate-control, i.e. libstd-rs is corrupted by the rebuild and is including files it should not.

Cleaning librsvg doesn&apos;t help since the corruption is in libstd-rs.

We need to ensure rebuilds in an existing build directory are clean.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94542</commentid>
    <comment_count>1</comment_count>
    <who name="Deepthi H">deepadeepthi98</who>
    <bug_when>2022-12-16 10:03:40 +0000</bug_when>
    <thetext>Updated the Rust from 1.63 to 1.64 
Git checkout b72193a602 
Bitbake core-image-minimal
Edited the conf/local.conf
SDK_TOOLCHAIN_LANGS += &quot;rust”
CORE_IMAGE_EXTRA_INSTALL += &quot;rust&quot;
IMAGE_INSTALL:append = &quot; librsvg&quot;
Ran the build and again updated it to Rust 1.65 
git pull origin master
And triggered the build.
Manually added 2 .rmeta files and ran the build.
Copied the sstate cache from one directory to another and vice versa and built.
The issue was still not reproducible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94617</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-01-05 14:21:38 +0000</bug_when>
    <thetext>Sundeep isn&apos;t able to reproduce this. Richard said that he&apos;d try again at some point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94746</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-01-18 10:03:51 +0000</bug_when>
    <thetext>I confirmed that manifest-core2-64-libstd-rs.populate_sysroot:/media/build/poky2/build/tmp/sysroots-components/core2-64/libstd-rs/usr/lib/rustlib/x86_64-poky-linux-gnu/lib/libcore-5c7322bf8f654199.rmeta comes from rust 1.64, commit b72193a602c9f58be37d5591b83324ab86311477

I still haven&apos;t found which revision produces the other hash.

I did try building the commit before 1.64, the building the commit above and that didn&apos;t reproduce the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94747</commentid>
    <comment_count>4</comment_count>
    <who name="Alex Kiernan">alex.kiernan</who>
    <bug_when>2023-01-18 10:33:49 +0000</bug_when>
    <thetext>I saw this when collapsing all the piecemeal patching into rust-source.inc - that wasn&apos;t changing any of the versions, only the sources. I wonder if this problem is something along the lines of rebuilding a version with different components so you get an underlying hash change, which leads to this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94755</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-01-18 17:58:20 +0000</bug_when>
    <thetext>I was able to reproduce this:

a) clone a fresh poky repository at revision 
b72193a602c9f58be37d5591b83324ab8631147
b) set DL_DIR to a common location but not SSTATE_DIR or any sstate mirrorc
c) &quot;bitbake librsvg&quot;.
d) update the git checkout to c6d8d49167f069b792ac4a76d90170073ba9ba49
e) &quot;bitbake librsvg&quot;

then it will fail as described originally. These are commits immediately after the upgrade to 1.64.

The question is why the libstd-rs build is corrupted like this, it shouldn&apos;t be.

Sundeep: Could you see if you could reproduce this now and if so, look and see if anything can be improved to avoid it please?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94756</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-01-18 17:59:10 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; I saw this when collapsing all the piecemeal patching into rust-source.inc -
&gt; that wasn&apos;t changing any of the versions, only the sources. I wonder if this
&gt; problem is something along the lines of rebuilding a version with different
&gt; components so you get an underlying hash change, which leads to this?

I think that is entirely possible. So far I&apos;ve worked to create a reproducible test case. Hopefully once we have that we&apos;ll be able to analyse things and work out if that is the case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94792</commentid>
    <comment_count>7</comment_count>
    <who name="Sundeep Kokkonda">sundeep.kokkonda</who>
    <bug_when>2023-01-25 13:22:37 +0000</bug_when>
    <thetext>We analyzed the sigdata of the librsvg &amp; libstd-rs artifacts and found sstate hash differences is causing by the changes riscv32 -&gt; riscv32gc &amp; riscv64 -&gt; riscv64gc with commit id #6608c076f64. 

Along with this the python bbclass also changed with another commit.

I suspect 6608c076f64 causing this issue. Since the rust version is identical the rebuild is not cleaning the old rmeta files and creating a new rmeta with different hash id.

We will analyze these changes further and update here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95035</commentid>
    <comment_count>8</comment_count>
    <who name="Sundeep Kokkonda">sundeep.kokkonda</who>
    <bug_when>2023-03-01 17:03:39 +0000</bug_when>
    <thetext>This issue is occuring because of the below commit.
e33afcd0dc rust-common.bbclass: use built-in rust targets for -native builds

This commit is causing to generate the 2nd rmeta file &apos;libcore-c5fc82c620226960.rmeta&apos;. It is suspected that the &apos;host&apos; tag change from &apos;x86_64-linux-gnu&apos; -&gt; &apos;x86_64-unknown-linux-gnu&apos; causing this other rmeta file generation (&apos;host&apos; tag found in .rustc_info.json file). But, to confirm that we&apos;ve analyzed the sigdata &amp; *.d files of librsvg/libstd-rs modules but those are not showing any differences.
Refer the detailed discussion is in below link.
https://lists.openembedded.org/g/openembedded-core/topic/96811314</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101084</commentid>
    <comment_count>9</comment_count>
    <who name="Etienne Cordonnier">ecordonnier</who>
    <bug_when>2025-02-15 22:08:43 +0000</bug_when>
    <thetext>When updating from 5.0.6 to 5.0.7 using a build directory populated with 5.0.6, a patch in binutils  ( 1e47fd8e4427f9d84048139804f75b83471bab28 ) causes a rebuild of libstd-rs. This seems to trigger this bug: libstd-rs then installs a second version of the rust standard library into e.g. tmp/work/armv8a-poky-linux/libstd-rs/1.75.0/sysroot-destdir/usr/lib/rustlib/aarch64-poky-linux-gnu/lib/

The work-around is to cleansstate libstd-rs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104871</commentid>
    <comment_count>10</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-03-31 14:36:21 +0000</bug_when>
    <thetext>Bug review:

with the data from Etienne&apos;s data, Sundeep with see if someone can reproduce this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105641</commentid>
    <comment_count>11</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-05-28 13:37:37 +0000</bug_when>
    <thetext>Waiting on Richard to review Sundeep&apos;s analysis.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>