Bug 13915 - file-native needs dependency on bzip2-replacement-native
Summary: file-native needs dependency on bzip2-replacement-native
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 3.1
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 3.2 M1
Assignee: Jan-Simon Moeller
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-05-21 05:55 UTC by Jan-Simon Moeller
Modified: 2020-07-16 07:58 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan-Simon Moeller 2020-05-21 05:55:03 UTC
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/#> 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/#> 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/#> 
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 -> libbz2.so.1.0.6
        │   ├── libbz2.so.1 -> libbz2.so.1.0.6
        │   └── libbz2.so.1.0.6
        └── share

#> 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 "NEEDED" 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        <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
./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           <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
./usr/lib/libarchive.so.13.4.2 :   NEEDED               libbz2.so.1




Inspecting the file recipe, we probably miss a bzip2-replacement-native in DEPENDS.
Comment 1 Jan-Simon Moeller 2020-05-21 07:21:55 UTC
Patches to oe-core are submitted as:

https://patchwork.openembedded.org/patch/172742/  (master)
https://patchwork.openembedded.org/patch/172743/  (dunfell)
Comment 2 Jan-Simon Moeller 2020-05-21 08:19:50 UTC
For reference:

https://people.gnome.org/~federico/blog/preparing-the-bzip2-107-release.html