I'm not sure how to prove it, but just noticed that while c++ parts are running as expected with jobs=1, moc uses jobs=ncpu causing unnecessary system load despite DISABLE_MAKE_JOBS=poudriere being present.
This probably is more of a CMake problem than specific to qt6-base. Could you try adding CMAKE_ARGS+=-DCMAKE_AUTOGEN_PARALLEL=${MAKE_JOBS_NUMBER} to the Makefile and see if that helps?
(In reply to Jason E. Hale from comment #1) Thanks for suggestion. Interesting, especially while documentation [0] states that default is unset. However, there's also option with similar name [1], which "sets the number of threads/processes to the number of physical CPUs on the host system" if empty, so I'll definitely try that. Perhaps there's also some option exist to log process spawns? [0]: https://cmake.org/cmake/help/latest/variable/CMAKE_AUTOGEN_PARALLEL.html [1]: https://cmake.org/cmake/help/latest/prop_tgt/AUTOGEN_PARALLEL.html
Created attachment 251648 [details] v1 This should fix the issue. I'm not seeing multiple moc processes spawn when DISABLE_MAKE_JOBS=yes.
(In reply to Jason E. Hale from comment #3) I can confirm that with the patch, no excess moc processes being spawned. BTW, either CMake documentation is incorrect or it's the bug. I have 1 CPU, 4 physical cores, HT -- and previously, 8 moc processed were spawned, which doesn't align with "number of threads/processes to the number of physical CPUs" in any way. However, I don't work with CMake extensively, so not willing to report this upstream. P.S. I wish someone from gecko@ could review PRs so quick...
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3ecb58c61953097c5b5331c3e11ae8fced410ca9 commit 3ecb58c61953097c5b5331c3e11ae8fced410ca9 Author: Jason E. Hale <jhale@FreeBSD.org> AuthorDate: 2024-06-29 05:20:51 +0000 Commit: Jason E. Hale <jhale@FreeBSD.org> CommitDate: 2024-06-29 05:20:51 +0000 Mk/Uses/cmake.mk: Respect MAKE_JOBS_NUMBER Pass -DCMAKE_AUTOGEN_PARALLEL:STRING="${MAKE_JOBS_NUMBER}" to avoid spawning more moc and uic processes than the user has specified via MAKE_JOBS_NUMBER and to limit to 1 if the user has DISABLE_MAKE_JOBS set. PR: 279908 Reported by: Anton Saietskii <vsasjason@gmail.com> Mk/Uses/cmake.mk | 1 + 1 file changed, 1 insertion(+)
(In reply to Anton Saietskii from comment #4) > I can confirm that with the patch, no excess moc processes being spawned. Thanks for confirming! Committed. > BTW, either CMake documentation is incorrect or it's the bug. > I have 1 CPU, 4 physical cores, HT -- and previously, 8 moc processed were spawned, > which doesn't align with "number of threads/processes to the number of physical CPUs" > in any way. > However, I don't work with CMake extensively, so not willing to report this upstream. It's probably more of a documentation bug by means of generalization. CMake, at least for FreeBSD, uses what is reported by `sysctl -n hw.ncpu` to determine the number of CPUs for this purpose. On my laptop, I also have 1 CPU with 4 physical cores with HT and the output of that command is "8", so it would make sense that up to and including 8 processes would be spawned before this change. > P.S. I wish someone from gecko@ could review PRs so quick... I don't like commenting on FreeBSD ports teams that I'm not involved with, but some are way more understaffed than others and sometimes sadly only consist of one person, so it may take more time for them to address PRs. We at kde@ are currently a relatively robust team and do our best to stay on top of things. Even still, we do miss things such as this and appreciate your report.