Hi buddies, i'm trying to port SimulIDE and i have a a slight inconvenience with dependencies building. It's very, very long for some of them, like lang/rust. I've changed some settings, like the number of parallel tasks, but it's still very slow, so here's my question. Do you have any configurations or tips to save time on compilation when porting a new port? Have a nice day everybody !
edit: I've checked the source code and i don't understand why it's trying to build lang/rust. Simulde is based on Qt and written in C++.
It's likely building rust because QT and friends depends on mesa a few levels down.
To answer your question, you can use sccache/ccache but it's not 100% bulledproof (in short you may get weird fallouts)
You can use binary packages which may work fine on leaf ports but you may also end up some odd build issues.
The best answer is more computing power (and RAM) along with tuning.
Example, this is running on a Ryzen 7900 (12+12)
This tells Poudriere to run 7 workers (port builds) at the same time
Code:
/usr/local/etc/poudriere.conf
...
PARALLEL_JOBS=7
...
This tells Poudriere to use 8 jobs (threads) per worker (port build)
Code:
/usr/local/etc/poudriere.d/make.conf
DISABLE_VULNERABILITIES=yes
MAKE_JOBS_NUMBER_LIMIT=8
Optional but it helps iron out build and C/CXX/FLAGS issues, this needs to be adjusted to what hardware you're running on and the name of your jail
Code:
/usr/local/etc/poudriere.d/143amd64-dev-make.conf
CPUTYPE?=znver4
You always want to overbook CPU capacity, there's no easy recipe but you need to balance it between amount of cores and possibly take amount of RAM into account
A good rule of thumb is that you want jobs to finish fast rather than doing loads in parallel
Things to take into account,
Far from all ports utilize the max amount of jobs allowed all the time. We spend a ton of time running configure scripts (autotools) which are very slow and compute intensive (one of many reasons to move away from it) compared to pretty much anything else such as cmake, meson, waf so you may end up with multiple workers running configure or another single threaded operation while you have maybe 2 doing compiling. If you have an older box but still many cores you might be better off dailing down PARALLEL_JOBS and up MAKE_JOBS_NUMBER_LIMIT but at the same time you don't want unnecessary idling cores but you'll inevitably run into it in some scenarios such building llvm, gcc or rust which some commonly used libraries depends on.