pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg_install fails when archivers/xz is installed



On 2020-07-28 11:55, Greg Troxel wrote:
Jason Bacon <outpaddling%yahoo.com@localhost> writes:

The problem seems to be simply this:

If OS == CentOS7 && /usr/include/lzma.h exists during bootstrap, then
installing archivers/xz will break all pkg_install binaries, because
they try ${PREFIX}/lib/liblzma.so first even though they were linked
against /usr/lib64/liblzma.so.
As I understand it, ELF has a list of needed libraries and a list of
paths, and each library is looked up in the list of paths.  Use objdump
-x to look.  On NetBSD, /opt/pkg/sbin/pkg_add looks like:

Dynamic Section:
   NEEDED               libssl.so.12
   NEEDED               libcrypto.so.12
   NEEDED               libarchive.so.4
   NEEDED               libbz2.so.1
   NEEDED               libz.so.1
   NEEDED               libc.so.12
   RPATH                /usr/pkg/lib

So I think we need to ensure that pkg_install binaries always use
/usr/lib64/liblzma.so if that's what it linked against.  In fact, I
wonder if they should ever be looking for anything in ${PREFIX}/lib.
I would expect they need both.  On my netbsd-8 system, they need pkgsrc
openssl, and they need libarchive.

Unfortunately there is no "get this librrary from this place, and this
other library from this other place", as I understand it.


To me, this is a reason to set pkgsrc to never use base system libzma.
Or perhaps, to have all uses of libzma follow the same builtin logic.

Similar on CentOS:

  NEEDED               libssl.so.10
  NEEDED               libcrypto.so.10
  NEEDED               libbz2.so.1
  NEEDED               libz.so.1
  NEEDED               libc.so.6
  RPATH                /usr/pkg/lib

Does it actually use pkgsrc openssl or base?  Maybe I'm misinterpreting something, but it seems to me that pkg_install can't depend on any other packages because all packages depend on pkg_install.  It seems to use only builtins and bundled deos:

# grep include Makefile
.include "../../mk/bsd.prefs.mk"
.include "../../mk/compiler.mk"
.include "../../archivers/bzip2/builtin.mk"
.include "../../archivers/xz/builtin.mk"
.include "../../archivers/libarchive/builtin.mk"
.include "../../devel/zlib/builtin.mk"
.include "../../security/openssl/builtin.mk"
.include "options.mk"
.include "../../mk/bsd.pkg.mk"

# ls work/
bzip2  libarchive  libfetch  libnbcompat  netpgp pkg_install-20200701  zlib

On my NetBSD system:

NetBSD netbsddev.acadix  bacon ~ 1003: (pkgsrc): ldd /usr/pkg/sbin/pkg_create
/usr/pkg/sbin/pkg_create:
        -lssl.12 => /usr/lib/libssl.so.12
        -lcrypto.12 => /usr/lib/libcrypto.so.12
        -lcrypt.1 => /lib/libcrypt.so.1
        -lc.12 => /usr/lib/libc.so.12
        -larchive.4 => /usr/lib/libarchive.so.4
        -lbz2.1 => /usr/lib/libbz2.so.1
        -lexpat.2 => /usr/lib/libexpat.so.2
        -llzma.2 => /usr/lib/liblzma.so.2
        -lpthread.1 => /usr/lib/libpthread.so.1
        -lz.1 => /usr/lib/libz.so.1

So I'm not seeing why RPATH is pointing to ${PREFIX}/lib.



Home | Main Index | Thread Index | Old Index