Page MenuHomeFreeBSD

libutil++: Move to the utilities package
ClosedPublic

Authored by markj on Aug 14 2025, 2:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 5:25 PM
Unknown Object (File)
Fri, Oct 10, 12:15 PM
Unknown Object (File)
Fri, Oct 10, 12:15 PM
Unknown Object (File)
Fri, Oct 10, 12:01 AM
Unknown Object (File)
Fri, Oct 10, 12:00 AM
Unknown Object (File)
Thu, Oct 9, 8:05 PM
Unknown Object (File)
Sat, Sep 20, 1:21 AM
Unknown Object (File)
Thu, Sep 18, 10:25 AM
Subscribers

Details

Summary

We should keep the clibs package as small as possible. Currently it
contains some "extra" libraries, but this isn't a good argument for
adding more stuff. Move it to where libutil lives.

Requested by: kib
Fixes: f4fd2aa07cde ("libutil++: Move to clibs")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Aug 14 2025, 2:37 PM
ivy added a reviewer: pkgbase.

this moves it to -utilities, which isn't where libutil lives (that's -runtime) but is the correct place for libutil++ in my opinion. libutil is only in runtime because some other binaries in runtime depend on libutil, but libutil++ doesn't include any libraries, so that can never be the case. to avoid bloating runtime, it should be in utilities.

This revision is now accepted and ready to land.Aug 14 2025, 2:46 PM

Add a comment to explain the rationale a bit further.

This revision now requires review to proceed.Aug 14 2025, 3:01 PM
In D51898#1186143, @ivy wrote:

this moves it to -utilities, which isn't where libutil lives (that's -runtime) but is the correct place for libutil++ in my opinion. libutil is only in runtime because some other binaries in runtime depend on libutil, but libutil++ doesn't include any libraries, so that can never be the case. to avoid bloating runtime, it should be in utilities.

Oops, I missed that somehow, I'll update the commit log message.

Looking at other INTERNALLIBS, I suspect they should all just live in FreeBSD-utilities? It probably doesn't matter much though.

lib/libutil++/Makefile
7

Any particular reason you moved it down here? I believe it's usually at the top?

Most internal libraries don't install anything. Some provide fake package names (PACKAGE=lib${LIB}).

libder               ???
libdiff              ???
libelftc             ???
libifconfig          libifconfig
libiscsiutil         iscsi
liblua               ???
libnetbsd            libnetbsd
libnvmf              nvmf
libopenbsd           libopenbsd
libsamplerate        ???
libutil++            clibs
libpe                ???
libpfctl             libpfctl
libpmcstat           libpmcstat
libsm                sendmail
libsmdb              libsmdb
libsmutil            libsmutil
libtelnet            libtelnet
liblutok             ???
In D51898#1186155, @des wrote:

Most internal libraries don't install anything. Some provide fake package names (PACKAGE=lib${LIB}).

i'll audit these and make a separate review to fix them.

In D51898#1186155, @des wrote:

Most internal libraries don't install anything. Some provide fake package names (PACKAGE=lib${LIB}).

And those that don't define package names end up in FreeBSD-utilities (the bsd.lib.mk default). So perhaps the right solution is to simply omit the PACKAGE definition here?

libder               ???
libdiff              ???
libelftc             ???
libifconfig          libifconfig
libiscsiutil         iscsi
liblua               ???
libnetbsd            libnetbsd
libnvmf              nvmf
libopenbsd           libopenbsd
libsamplerate        ???
libutil++            clibs
libpe                ???
libpfctl             libpfctl
libpmcstat           libpmcstat
libsm                sendmail
libsmdb              libsmdb
libsmutil            libsmutil
libtelnet            libtelnet
liblutok             ???

And those that don't define package names end up in FreeBSD-utilities (the bsd.lib.mk default). So perhaps the right solution is to simply omit the PACKAGE definition here?

I'd like to say yes but make -VPACKAGE with no PACKAGE defined int the Makefile produces no output, so we should take a closer look at how that default is implemented. I don't doubt that it works correctly, but I would want make -VPACKAGE to show me the effective value.

In D51898#1186191, @des wrote:

And those that don't define package names end up in FreeBSD-utilities (the bsd.lib.mk default). So perhaps the right solution is to simply omit the PACKAGE definition here?

I'd like to say yes but make -VPACKAGE with no PACKAGE defined int the Makefile produces no output, so we should take a closer look at how that default is implemented. I don't doubt that it works correctly, but I would want make -VPACKAGE to show me the effective value.

This works (but it gets hairier for some of the other bsd.*.mk, like bsd.conf.mk):

diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 3013f32c2b36..f0d157a16cb6 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -68,9 +68,10 @@ TAGS+=       lib${_libcompat}
 .endif
 .endfor
 
+PACKAGE?= utilities
 .if defined(NO_ROOT)
 .if !defined(TAGS) || ! ${TAGS:Mpackage=*}
-TAGS+=         package=${PACKAGE:Uutilities}
+TAGS+=         package=${PACKAGE}
 .endif
 TAG_ARGS=      -T ${TAGS:ts,:[*]}
 .endif

Take three: simply take the default PACKAGE value from bsd.lib.mk, like
some other INTERNALLIBs do.

This works (but it gets hairier for some of the other bsd.*.mk, like bsd.conf.mk):

yeah I agree, let's leave well enough alone

This revision is now accepted and ready to land.Aug 14 2025, 4:00 PM
This revision was automatically updated to reflect the committed changes.