# Forecasting and Describing Compile Times in poudriere with 12.1



## gladiola (Jun 15, 2020)

My poudriere server seems to have two classes of programs:  those which compile in under two minutes, and llvm80-and-friends.  Chromium, Firefox, Rust :  they'll be over six hours.  Do we have any references that can help us identify which ports will result in these long build times?

How do we know how long it took to build each program, and its dependencies, total?

I could drag through my past builds and try to find the elapsed times; but, I would like to know, including cumulative dependency build duration, how long does it take to build each program?  I understand that there would be a lot of variance because of processing capacity from machine to machine.

Is there a way to use existing resources to gather this kind of data from a poudriere build without going through and manually noting each build time and tracking down the dependency tree by hand?

Maybe also show how much time might have been saved or consumed by having previously compiled dependencies on hand in the jail poudriere is using?

I thought this might be useful for identifying stalled builds and better understanding the quality of programs to be built together in a jail. 

It's almost as though these majorly long builds need to be kicked and busted into smaller ports that can be collectively assembled as units in a reasonable amount of time.  That, however, is another set of questions.  Like, why is _____ port such a hideous build in the first place?  Why would a port be created that requires so many hours of building and rebuilding?  Then, when there are updates, why are we subjected to those long build times? 

But, for now, I would like to find out:  Is there a way to find out about sum build times?


----------



## Sevendogsbsd (Jun 16, 2020)

Not sure there is a way to tell. It really depends on hardware: cores, ram and disk IO (maybe?). I used to build on monster hardware and had devel/ccache set up. Llvm, open office, rust, chromium and firefox used to take me about 3 or 4 hours, including about 700 other ports but that not on a laptop or even a general purpose machine. 

I eventually sold my build box and just went back to packages. But then I have had to accept the default options so there is a trade-off.


----------



## gladiola (Jun 16, 2020)

Thanks for the tip about ccache.  I will give that a try.  I just had a Chromium build quit on its own after 24 hours. 



I am trying an approach where I break up the desired builds into smaller groupings of programs per jail.  This is okay most of the time, but those llvms and rust is just killing me.  I may end up having to pick programs that go without it.  This jail, pictured above, was just for browsers.  

One of the detriments of this approach is that I may end up recompiling programs that were just compiled in an adjacent jail.  Not sure if ccache will help me in those situations, but it's worth a try.  Early on, I was failing a lot.  I was burdening the builds with long port lists.  Trying this smaller approach is yielding a higher rate of success.  Usually, if something fails, it'll be the last item.  I can live with some failures.  There is probably a way to fall back to the last successful build for just one program in the poudriere jail, but I don't know how to do that yet.  

My last log entry for that failed build closed with the words "unreachable code." 



Probably a coincidence.


----------



## Sevendogsbsd (Jun 16, 2020)

There are quite a few people here that use poudriere so they can probably offer better advice than I for your idea of breaking things apart.


----------



## suntzu00 (Jun 17, 2020)

looking at the building time for those ports that machine looks resource starved.


----------



## SirDice (Jun 17, 2020)

Jobs that  run for more than 24 hours are killed. Hence the build failure. Try setting this in poudriere.conf to see if it improves things a bit:

```
ALLOW_MAKE_JOBS_PACKAGES="pkg llvm* gcc* node* rust* firefox* chromium"
```


----------



## Lamia (Jun 18, 2020)

SirDice said:


> Jobs that run for more than 24 hours are killed.


Building an llvm takes over 24hrs here. Part of it is that several versions are concurrently built at the time.


----------



## Lamia (Jun 18, 2020)

gladiola said:


> Not sure if ccache will help me in those situations,


Ccache will help. Set up a ccache in the host and use fstab to make it available for each jail.


----------

