Bug 195467 - ports-mgmt/pkg built from ports reports it needs to be reinstalled
Summary: ports-mgmt/pkg built from ports reports it needs to be reinstalled
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-28 11:16 UTC by Peter Jeremy
Modified: 2018-01-09 00:20 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Jeremy freebsd_committer freebsd_triage 2014-11-28 11:16:02 UTC
I usually locally build all ports but decided to install lang/squeak to check an issue reported on a mailing list.  Unfortunately, pkg insists that it needs to be reinstalled, even after being freshly rebuilt:

server% sudo pkg install lang/squeak 
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
New version of pkg detected; it needs to be installed first.
The following 1 packages will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        pkg-1.3.8_3 (needed shared library changed)

The operation will free 301 KB.
2 MB to be downloaded.

Proceed with this action? [y/N]: n
server% pkg info pkg-1.3.8_3
pkg-1.3.8_3
Name           : pkg
Version        : 1.3.8_3
Installed on   : Fri Nov 28 06:31:33 EST 2014
Origin         : ports-mgmt/pkg
Architecture   : freebsd:10:x86:64
Prefix         : /usr/local
Categories     : ports-mgmt
Licenses       : BSD2CLAUSE
Maintainer     : portmgr@FreeBSD.org
WWW            : http://wiki.freebsd.org/pkgng
Comment        : Package manager
Shared Libs required:
        libexecinfo.so.1
Shared Libs provided:
        libpkg.so.3
Flat size      : 9.60MiB
Description    :
Package management tool

WWW: http://wiki.freebsd.org/pkgng

server% pkg search -fe pkg-1.3.8_3
pkg-1.3.8_3
Name           : pkg
Version        : 1.3.8_3
Installed on   : Thu Jan  1 10:00:00 EST 1970
Origin         : ports-mgmt/pkg
Architecture   : freebsd:10:x86:64
Prefix         : /usr/local
Repository     : FreeBSD [pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest]
Categories     : ports-mgmt
Licenses       : BSD2CLAUSE
Maintainer     : portmgr@FreeBSD.org
WWW            : http://wiki.freebsd.org/pkgng
Comment        : Package manager
Shared Libs provided:
        libpkg.so.3
Flat size      : 9.31MiB
Pkg size       : 2 MB
Description    :
Package management tool

WWW: http://wiki.freebsd.org/pkgng
server% 

The only obvious difference is the requirement for libexecinfo.so.1 in the installed version.  The reason for this is unclear - it's not listed anywhere in the Makefile, though the configure script does test for it.  It's present in the base system, though I also have libexecinfo-1.1_3 installed (as a requirement for llvm and samba) and ldd shows pkg is relying on the port:

server% ldd /usr/local/sbin/pkg   
/usr/local/sbin/pkg:
        libpkg.so.3 => /usr/local/lib/libpkg.so.3 (0x80086f000)
        libelf.so.1 => /usr/lib/libelf.so.1 (0x800c3e000)
        libexecinfo.so.1 => /usr/local/lib/libexecinfo.so.1 (0x800e53000)
        libfetch.so.6 => /usr/lib/libfetch.so.6 (0x801056000)
        libutil.so.9 => /lib/libutil.so.9 (0x801268000)
        libssl.so.7 => /usr/lib/libssl.so.7 (0x80147a000)
        libcrypto.so.7 => /lib/libcrypto.so.7 (0x8016e4000)
        libm.so.5 => /lib/libm.so.5 (0x801ad7000)
        libjail.so.1 => /lib/libjail.so.1 (0x801cfd000)
        libarchive.so.6 => /usr/lib/libarchive.so.6 (0x801f02000)
        libz.so.6 => /lib/libz.so.6 (0x80219d000)
        libbz2.so.4 => /usr/lib/libbz2.so.4 (0x8023b3000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x8025c5000)
        libc.so.7 => /lib/libc.so.7 (0x8027ea000)
        libbsdxml.so.4 => /lib/libbsdxml.so.4 (0x802b86000)

A friend who has also built pkg reports the same behaviour.
There are multiple issues here:
- Why is a freshly built pkg reporting it needs to be reinstalled?
- Why doesn't pkg report details of why it needs to be reinstalled? Which shared library has changed and how?
- Why is pkg linking against a library not listed as a dependency?
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-11-28 11:16:02 UTC
Maintainers CC'd
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2014-12-29 23:24:48 UTC
We are working on this.
Comment 3 Walter Schwarzenfeld 2018-01-08 15:38:45 UTC
I think could be closed pkg has 1.10.4.
Comment 4 Peter Jeremy freebsd_committer freebsd_triage 2018-01-09 00:20:04 UTC
I haven't seen this with recent versions of pkg so I'll assume it got fixed along the way.