Bug 249143 - pkgbase: Library archive files .a found in non *-dev packages
Summary: pkgbase: Library archive files .a found in non *-dev packages
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: pkgbase
Depends on:
Blocks:
 
Reported: 2020-09-06 08:03 UTC by Martin
Modified: 2020-10-11 12:56 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 Martin 2020-09-06 08:03:49 UTC
Following *.a files are found in non dev pkgbase packages

clibs.plist:             /usr/lib/libcurses.a
clibs.plist:             /usr/lib/libcursesw.a
clibs.plist:             /usr/lib/libpthread.a
clibs.plist:             /usr/lib/libtermcap.a
clibs.plist:             /usr/lib/libtermcapw.a
clibs.plist:             /usr/lib/libtermlib.a
clibs.plist:             /usr/lib/libtermlibw.a
clibs.plist:             /usr/lib/libtinfo.a
clibs.plist:             /usr/lib/libtinfow.a
libcompiler_rt.plist:    /usr/lib/libgcc.a
utilities.plist:         /usr/lib/libfl.a
utilities.plist:         /usr/lib/libl.a
utilities.plist:         /usr/lib/libutempter.a

except /usr/lib/libfl.a /usr/lib/libl.a (what are those?), all are symlinks to other libraries:

/usr/lib/libcurses.a@    ->  libncurses.a
/usr/lib/libcursesw.a@   ->  libncursesw.a
/usr/lib/libpthread.a@   ->  libthr.a
/usr/lib/libtermcap.a@   ->  libncurses.a
/usr/lib/libtermcapw.a@  ->  libncursesw.a
/usr/lib/libtermlib.a@   ->  libncurses.a
/usr/lib/libtermlibw.a@  ->  libncursesw.a
/usr/lib/libtinfo.a@     ->  libncurses.a
/usr/lib/libtinfow.a@    ->  libncursesw.a
/usr/lib/libgcc.a@       ->  libcompiler_rt.a
/usr/lib/libfl.a
/usr/lib/libl.a
/usr/lib/libutempter.a@  ->  libulog.a

the symlink targets are already in the respective dev packages, so shouldn't the symlinks themself be there as well?
Comment 1 Ed Maste freebsd_committer 2020-09-07 17:45:23 UTC
> the symlink targets are already in the respective dev packages, so shouldn't
> the symlinks themself be there as well?

Yes, they should. These come from cases like (from lib/ncurses/ncurses/Makefile):

.if ${MK_INSTALLLIB} != "no"
SYMLINKS+=      libncurses${LIB_SUFFIX}.a ${LIBDIR}/libcurses${LIB_SUFFIX}.a
SYMLINKS+=      libncurses${LIB_SUFFIX}.a ${LIBDIR}/libtermcap${LIB_SUFFIX}.a
SYMLINKS+=      libncurses${LIB_SUFFIX}.a ${LIBDIR}/libtermlib${LIB_SUFFIX}.a
SYMLINKS+=      libncurses${LIB_SUFFIX}.a ${LIBDIR}/libtinfo${LIB_SUFFIX}.a
.endif

We don't currently have a way to tag symlinks as belonging to -dev.
Comment 2 Martin 2020-09-20 10:45:49 UTC
There are some dangling symlinks related to ncurses:
dangling: /usr/lib/libtinfow.so -> libncursesw.so
dangling: /usr/lib/libtermlib.so -> libncurses.so
dangling: /usr/lib/libtinfo.so -> libncurses.so
dangling: /usr/lib/libcurses.so -> libncurses.so
dangling: /usr/lib/libtermcapw.so -> libncursesw.so
dangling: /usr/lib/libcursesw.so -> libncursesw.so
dangling: /usr/lib/libtermcap.so -> libncurses.so
dangling: /usr/lib/libtermlibw.so -> libncursesw.so


and some other dangling links:
dangling: /usr/lib/libpthread.so -> libthr.so
dangling: /usr/lib/libutempter.so -> libulog.so
dangling: /usr/lib/libxnet.so -> libc.so
dangling: /usr/lib/libxo/encoder/test.enc -> /usr/tests/lib/libxo/libenc_test.so
Comment 3 Martin 2020-10-11 12:56:21 UTC
Searching for these symlinks in the METALOG shows this (i omitted the uname=, gname=, mode= and flags= properties):

grep -E "lib(c|ncurses.*|pthread|thr|ulog|utempter|xnet)\.so" /usr/obj/usr/src/amd64.amd64/worldstage/METALOG | sort -b -k 7 | column -t

./lib/libc.so.7           type=file ... size=2031360                     tags=package=clibs
./lib/libncurses.so.9     type=file ... size=401496                      tags=package=clibs
./lib/libncursesw.so.9    type=file ... size=459800                      tags=package=clibs
./lib/libthr.so.3         type=file ... size=129744                      tags=package=clibs
./usr/lib/libcurses.so    type=link ... link=libncurses.so               tags=package=clibs
./usr/lib/libcursesw.so   type=link ... link=libncursesw.so              tags=package=clibs
./usr/lib/libpthread.so   type=link ... link=libthr.so                   tags=package=clibs
./usr/lib/libtermcap.so   type=link ... link=libncurses.so               tags=package=clibs
./usr/lib/libtermcapw.so  type=link ... link=libncursesw.so              tags=package=clibs
./usr/lib/libtermlib.so   type=link ... link=libncurses.so               tags=package=clibs
./usr/lib/libtermlibw.so  type=link ... link=libncursesw.so              tags=package=clibs
./usr/lib/libtinfo.so     type=link ... link=libncurses.so               tags=package=clibs
./usr/lib/libtinfow.so    type=link ... link=libncursesw.so              tags=package=clibs
./usr/lib/libxnet.so      type=link ... link=libc.so                     tags=package=clibs
./usr/lib/libc.so         type=file ... size=134                         tags=package=clibs,dev
./usr/lib/libncurses.so   type=link ... link=../../lib/libncurses.so.9   tags=package=clibs,dev
./usr/lib/libncursesw.so  type=link ... link=../../lib/libncursesw.so.9  tags=package=clibs,dev
./usr/lib/libthr.so       type=link ... link=../../lib/libthr.so.3       tags=package=clibs,dev
./lib/libulog.so.0        type=file ... size=9552                        tags=package=utilities
./usr/lib/libutempter.so  type=link ... link=libulog.so                  tags=package=utilities
./usr/lib/libulog.so      type=link ... link=../../lib/libulog.so.0      tags=package=utilities,dev


The most dangling symlinks are symlinks pointing to another symlink, which does not exist. e.g.

/usr/lib/libcurses.so -> /usr/lib/libncurses.so -> ../../lib/libncurses.so.9

The reason it does not exist on my system, is, that i don't install the dev-, debug-, lib32- and tests-packages.

/usr/lib/libncurses.so   -> ../../lib/libncurses.so.9 
/usr/lib/libncursesw.so  -> ../../lib/libncursesw.so.9
/usr/lib/libthr.so       -> ../../lib/libthr.so.3
/usr/lib/libulog.so      -> ../../lib/libulog.so.0

/usr/lib/libc.so differs a little, because it is a text file, with this content:
GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a )

As i see it, at least the symlinks should be moved from the dev- to the "main" package. Or are there reason for the current placement?

The above mentioned /usr/lib/libxo/encoder/test.enc should be moved to the tests-package because the target is in the /usr/tests/ directory.