Page MenuHomeFreeBSD

vmimage.subr: pkg autoremove after pkg install
ClosedPublic

Authored by cperciva on Mon, Nov 3, 1:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 16, 6:55 PM
Unknown Object (File)
Sun, Nov 16, 6:42 AM
Unknown Object (File)
Tue, Nov 11, 11:28 AM
Unknown Object (File)
Wed, Nov 5, 8:15 AM
Unknown Object (File)
Tue, Nov 4, 7:02 PM
Unknown Object (File)
Tue, Nov 4, 7:02 PM
Unknown Object (File)
Tue, Nov 4, 7:02 PM
Unknown Object (File)
Tue, Nov 4, 4:22 PM
Subscribers

Details

Summary

A bug in pkg, which somehow only surfaced as a consequence of pkgbase,
results in pkg install sometimes pulling in false dependencies. This
problem might be limited to cases when the lib32 pkgbase packages are
not installed. In the case of EC2 "small" images, installing the
ebsnvme-id package results in binutils, gcc12-devel, gmp, indexinfo,
liblz4, mpc, mpfr, and zstd packages being installed.

These false dependencies are however not recorded as dependencies --
at some level pkg does understand that they're not needed -- so running
pkg autoremove immediately after pkg install cleans them up.

Note: This does not remove lines from METALOG corresponding to these
packages, and makefs emits an error when it attempts to create the
filesystem but cannot find the files listed in METALOG -- but makefs
does seem to complete normally despite the error messages.

This change should be reverted once the pkg issue has been located and
fixed.

MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva

Diff Detail

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

Event Timeline

i'm okay with this change but, based on what i remember of your original description of the problem, could explicitly installing FreeBSD-clibs-lib32 avoid it? or does it not actually require 32-bit libgcc at all?

release/tools/vmimage.subr
219

this doesn't feel like it should be required, but i see other pkg commands also set PKG_DBDIR explicitly... is there a reason for that?

This revision is now accepted and ready to land.Mon, Nov 3, 2:00 AM
In D53543#1222429, @ivy wrote:

i'm okay with this change but, based on what i remember of your original description of the problem, could explicitly installing FreeBSD-clibs-lib32 avoid it? or does it not actually require 32-bit libgcc at all?

It doesn't need 32-bit anything. Installing FreeBSD-clibs-lib32 makes the additional package installs go away, but that's just another symptom of the bug.

release/tools/vmimage.subr
219

I was cargo-culting. I wasn't sure if it was necessary given the -r flag but I didn't want to take time to check.