Re: Cache go packages to speed up builds in poudriere

From: Edward Sanford Sutton, III <mirror176_at_hotmail.com>
Date: Fri, 24 Feb 2023 10:44:26 UTC
On 2/23/23 07:01, Matthias Fechner wrote:
> Dear all,
> 
> is there a way that go (that is used by ports in poudriere) can cache go 
> packages?
> I ask because if I e.g. make a new port for devel/gitaly which uses go 
> and I make a test build, it takes about 30-45 minutes to download the 
> packages.

   There are upcoming changes to poudriere-devel that are not yet 
released that should impact determining what to delete and build as I 
understand it. There are bugs like 
https://github.com/freebsd/poudriere/issues/954 related to packages 
being removed when they should not be which will hopefully be properly 
addressed in various ways.

> And it seems that it is downloading the packages again and again with 
> each testbuild.

   I don't usually use package downloading as a step in poudriere runs 
but maybe see if not using packages with poudriere steps makes a better 
workflow. Poudriere normally only downloads distfiles if the file 
doesn't match anymore and goes through the full build sequence for 
dependencies starting at the first dependency that is changed from a 
ports tree update or changing build options for it and begins 
recursively reprocessing all ports that depended on it. A rerun of those 
build steps won't happen unless a dependency is incorrectly entered in 
the ports tree or I force a rebuild. Some ports are a long and resource 
intensive process to build but maybe it would help as a replacement to 
an 'always-download' package issue if the machine is fast enough while 
internet is slow enough.
   If not, my next idea would be to do a poudriere testbuild -i and just 
stay inside that jail doing multiple builds, installs, uninstalls as a 
test environment. I don't have experience with it but maybe an 
alternative like synth gives an environment you could compforably use, 
or just setup a jail or virtual machine where you can manually run 
package installs and ports tree make commands in a clean but isolated 
environment.

> As I have a really slow internet connection here, this is really very 
> time-consuming.

   Maybe there is a way to set up a local caching server to point 
poudriere at instead of the real package repositories so even if it 
downloaded again, it'd be downloading from your own machine instead of 
reaching the internet each time? Not a workflow I normally use so not 
sure what options may exist.

> Thanks a lot for any tips.
> 
> Gruß
> Matthias
>