Re: FreeBSD base pkg (packaging) and critical ports build alongside

From: David Chisnall <theraven_at_FreeBSD.org>
Date: Wed, 29 Sep 2021 08:42:46 UTC
Hi,

I think your best option would be to do the opposite of what you 
suggest.  Poudriere can build pkgbase sets from a source tree and 
populate a jail from them.  The flow that I'd suggest is:

  - Poudriere jail to build a jail from an existing source tree.
  - If there are kernel changes, install the packages on the package 
builder and reboot.
  - Poudriere bulk in the new jail to build the new package set.

Note: You can *normally* skip the second step (drm ports, for example, 
will be built against the new kernel sources in the jail, though they 
might not be loadable on the host) but there's no guarantee that you can 
run a newer userland on an older kernel so things may break.

If you enable reproduceable builds in the src.conf that you use for 
building the jail then you should be able to just diff the kernel binary 
to see if anything has changed.

If you have bhyve or are running on a cloud platform then you can 
replace the second step with a poudriere image invocation to build a VM 
image containing poudriere and your newly-built base system and deploy 
this to build the packages.  I'm planning on working on some tooling to 
do this in Azure with GitHub Actions.

Note that poudriere uses packages installed on the host system to build 
a jail.  If you have, for example, installed llvm12 then you can put a 
line in your src-env.conf for the jail to tell it to use that as an 
external toolchain and skip the toolchain-bootstrap phase of the build. 
  This means that the base-build is fairly fast even on quite modest 
hardware (it still builds clang, but at least it does it only once).

David


On 29/09/2021 09:28, FreeBSD User wrote:
> Hello,
> 
> I use FreeBSD-base packages built on self hosted systems to update 13-STABLE
> and CURRENT hosts.  I run into the problem, that the packages of the FreeBSD
> base, built via the FreeBSD framework and from most recent 13-STABLE sources,
> are often oit of synchronisation with our poudriere packaging builders, that is
> especially true for critical ports with kernel modules, like i915 drm,
> virtualbox and so on. The problem is, obviously, barehanded: 13-STABLE sources
> and probably the API changes more rapidly than those of the appropriate builder
> hosts for poudriere and since it takes a bunch of days to build a whole
> poudriere packages repository, there is often a gap between the revision of the
> kernel and the port containing kernel modules.
> 
> So, the question is: how can I add ports to the building process of the FreeBSD
> sources tree in the way they get build every time I build the FreeBSD-base
> packages alongside the OS?
> 
> Thanks in advance,
> 
> oh
>