Not sure if this is the right place to post this, but since this isn’t strictly a bug affecting any built projects, I’m avoiding the bugtracker…
I’ve been building kwin
and plasma-workspace
on my own for a long time now because I’m applying some minor patches that change some hardcoded default values which I don’t agree with upstream. The patches themselves however are irrelevant and are not the point of this thread. All they do is force me to fork Arch Linux’s respective packages and build them myself with these patches.
What I want to talk about in this thread is that both kwin
and plasma-workspace
apparently have some issues with their cmake configs. The problem is that when building, way too many build-jobs are queued, overwhelming the CPU scheduler and making the (desktop) system really unresponsive during the build time. Compiling other stuff like the Linux kernel for example, which of course is not cmake-based, but also other large projects which are cmake-based, do not have that problem.
My system uses a Ryzen 3950X (16C32T) with 64 GiB of RAM, and I have set -j32
. In well-behaving build-setups, this results in at most 32 build jobs being queued at a time, utilizing nearly 100% of my CPU, all while the system is staying responsive, as the CPU scheduler can handle the workload being thrown at it.
When building kwin
and plasma-workspace
on the other hand (I’m not building any other KDE projects at the moment), cmake queues way too many build jobs, which can be observed in htop
for example. As said, this results in the system being really unresponsive and freezing multiple times.
When forcing only one build-job (-j1
), everything is fine, well, except for it not being optimal and efficient. But as soon as more than one build job is set on the cmake --build
command, the number of build jobs explodes.
I am neither a C++/Qt developer, nor am I familiar with cmake itself. However, my suspicion is that it is spawning nested build jobs, ignoring the overall / top-level number of max parallel build jobs, so it exceeds the system’s capabilities.
Can someone shed some light on this? Could this be an issue with the cmake configs of these projects? Or could this be a cmake bug?
It’s not a huge problem, as it only affects me while building said projects, but it’s definitely something that I can only observe here, nowhere else. It is not a system configuration or a hardware problem.
Thanks!