<?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>13915</bug_id>
          
          <creation_ts>2020-05-21 05:55:03 +0000</creation_ts>
          <short_desc>file-native needs dependency on bzip2-replacement-native</short_desc>
          <delta_ts>2020-07-16 07:58: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>3.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jan-Simon Moeller">dl9pf</reporter>
          <assigned_to name="Jan-Simon Moeller">dl9pf</assigned_to>
          <cc>dl9pf</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</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>87271</commentid>
    <comment_count>0</comment_count>
    <who name="Jan-Simon Moeller">dl9pf</who>
    <bug_when>2020-05-21 05:55:03 +0000</bug_when>
    <thetext>Symptom: 
.../recipe-sysroot-native/usr/lib/rpm/rpmdeps: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or  directory

TLDR: Supposedly an issue with host dependencies creeping in the sstate-cache shared between 2 systems.

System#1 Debian 10  (building and serving sstate-cache)
System#2 openSUSE 15.1  (doing the 2nd build re-using the sstate-cache)

Details:
Debian uses libbz2-1.0

root@gandalf:/home/large/yocto/#&gt; dpkg -l libbz2-1.0
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name             Version           Architecture Description
+++-================-=================-============-============================================================
ii  libbz2-1.0:amd64 1.0.6-9.2~deb10u1 amd64        high-quality block-sorting file compressor library - runtime

root@gandalf:/home/large/yocto/#&gt; dpkg -L libbz2-1.0
/.
/lib
/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu/libbz2.so.1.0.4
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libbz2-1.0
/usr/share/doc/libbz2-1.0/changelog.Debian.gz
/usr/share/doc/libbz2-1.0/changelog.gz
/usr/share/doc/libbz2-1.0/copyright
/lib/x86_64-linux-gnu/libbz2.so.1
/lib/x86_64-linux-gnu/libbz2.so.1.0

root@gandalf:/home/large/yocto/#&gt; 
objdump -p /usr/lib/x86_64-linux-gnu/libbz2.so | grep SONAME
  SONAME               libbz2.so.1.0

2 notable things on the original debian library:
a) it claims to be 1.0.6 but has libbz2.so.1.0.4 ??
b) the SONAME is libbz2.so.1.0  (.1.0)


In comparison our own bzip2-native builds the same library as openSuSE 15.1:
root@gandalf:/home/large/yocto/sstate-cache/aarch64/universal/extract# tree
.
└── recipe-sysroot-native
    ├── sysroot-providers
    └── usr
        ├── bin
        ├── include
        ├── lib
        │   ├── libbz2.so -&gt; libbz2.so.1.0.6
        │   ├── libbz2.so.1 -&gt; libbz2.so.1.0.6
        │   └── libbz2.so.1.0.6
        └── share

#&gt; objdump -p recipe-sysroot-native/usr/lib/libbz2.so | grep SONAME
  SONAME               libbz2.so.1



System #1: Debian 10 (buster)
System #2: openSUSE 15.1

Any do_package will then fail with messages similar to:
.../recipe-sysroot-native/usr/lib/rpm/rpmdeps: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or  directory


Digging deeper:
It turns out that is is not the rpm or bz2 package that has the wrong &quot;NEEDED&quot; library name. Running objdump on all files in 
  base-files/3.0.14-r89/recipe-sysroot-native
shows that it must be likely file-native

./usr/bin/rpmkeys.real :   NEEDED               libbz2.so.1
./usr/bin/bzip2-native/bzip2recover :   NEEDED               libbz2.so.1
./usr/bin/bzip2-native/bzip2 :   NEEDED               libbz2.so.1
./usr/bin/rpm2cpio.real :   NEEDED               libbz2.so.1
./usr/bin/bsdcpio :   NEEDED               libbz2.so.1
./usr/bin/rpmdb.real :   NEEDED               libbz2.so.1
./usr/bin/rpmbuild.real :   NEEDED               libbz2.so.1
./usr/bin/rpmgraph.real :   NEEDED               libbz2.so.1
./usr/bin/rpm2archive.real :   NEEDED               libbz2.so.1
./usr/bin/rpmspec.real :   NEEDED               libbz2.so.1
./usr/bin/file-native/file.real :   NEEDED               libbz2.so.1.0        &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
./usr/bin/bsdtar :   NEEDED               libbz2.so.1
./usr/bin/rpm.real :   NEEDED               libbz2.so.1
./usr/bin/rpmsign.real :   NEEDED               libbz2.so.1
./usr/bin/bsdcat :   NEEDED               libbz2.so.1
./usr/lib/python3.8/site-packages/rpm/_rpms.so :   NEEDED               libbz2.so.1
./usr/lib/python3.8/site-packages/rpm/_rpmb.so :   NEEDED               libbz2.so.1
./usr/lib/python3.8/site-packages/rpm/_rpm.so :   NEEDED               libbz2.so.1
  NEEDED               libbz2.so.1
./usr/lib/rpm/rpmdeps.real :   NEEDED               libbz2.so.1
./usr/lib/rpm/debugedit :   NEEDED               libbz2.so.1
./usr/lib/rpm/elfdeps :   NEEDED               libbz2.so.1
./usr/lib/librpmsign.so.8.1.0 :   NEEDED               libbz2.so.1
./usr/lib/librpm.so.8.1.0 :   NEEDED               libbz2.so.1
./usr/lib/librpmio.so.8.1.0 :   NEEDED               libbz2.so.1
./usr/lib/librpmbuild.so.8.1.0 :   NEEDED               libbz2.so.1
./usr/lib/libmagic.so.1.0.0 :   NEEDED               libbz2.so.1.0           &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
./usr/lib/libarchive.so.13.4.2 :   NEEDED               libbz2.so.1




Inspecting the file recipe, we probably miss a bzip2-replacement-native in DEPENDS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87275</commentid>
    <comment_count>1</comment_count>
    <who name="Jan-Simon Moeller">dl9pf</who>
    <bug_when>2020-05-21 07:21:55 +0000</bug_when>
    <thetext>Patches to oe-core are submitted as:

https://patchwork.openembedded.org/patch/172742/  (master)
https://patchwork.openembedded.org/patch/172743/  (dunfell)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87292</commentid>
    <comment_count>2</comment_count>
    <who name="Jan-Simon Moeller">dl9pf</who>
    <bug_when>2020-05-21 08:19:50 +0000</bug_when>
    <thetext>For reference:

https://people.gnome.org/~federico/blog/preparing-the-bzip2-107-release.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87770</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-07-16 07:58:04 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=3c28c19791bfce1b099fe5b3159c59a034ffe5d1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>