Re: avoiding "install" for dependencies with PORTS_MODULES

From: Gleb Popov <>
Date: Wed, 04 May 2022 06:01:25 UTC
On Tue, May 3, 2022 at 11:59 PM G. Paul Ziemba <>

> An unfortunate property of building ports locally (as opposed to
> via poudriere) is that dependencies are often installed to the host
> file system during the build even when I am not doing "make install"
> to the target port.
> I normally sidestep this issue by using poudriere. However, I am trying
> to use PORTS_MODULES in conjunction with my kernel upgrade process to
> generate ports-based kernel modules matching the new kernel, to avoid the
> "disable kmods/reboot/build ports/reenable kmods" dance.
> It seems "make buildkernel" uses tool binaries from a prior "make
> buildworld".
> Is it possible to, in a like manner, cause the ports built via
> to install and use their dependencies in this same "world" staging tree
> (or in some alternate place) instead of directly in the host's file system?
> --
> G. Paul Ziemba
> FreeBSD unix:
>  9:21AM  up 130 days, 17:23, 15 users, load averages: 0.33, 0.35, 0.35

This is exactly the situation in which Poudriere helps. You can create a
Poudriere jail out of /usr/src and /usr/obj and then build all the needed
ports in the isolated environment. Once you finish, upgrade the host with
installkernel & installworld and just do pkg upgrade -r