Portage has fairly extensive support for using distcc, including the ability to create ebuilds (such as gcc) that will not use distcc even if enabled. However, when an ebuild that is set to not use distcc is merged on a system set up for distcc, the MAKEOPTS setting for distcc is still honored, which can result in a very high system load on a system configured for distcc. (For example, on my Gentoo hosts, I use MAKEOPTS="-j2" when not using distcc, but MAKEOPTS="-j13" with distcc.) I propose the addition of a DISTCC_MAKEOPTS variable which, if set, would be used in place of MAKEOPTS when and only when emerging with distcc. Builds that disable distcc would continue to use MAKEOPTS, and for backward compatibility, MAKEOPTS would be used as a fallback if DISTCC_MAKEOPTS was not set. Reproducible: Always
I can confirm this bug and would like to ask the development team to add this feature in the next update to distcc, if possible and not too of an effort to ask for.
A good workaround for this issue is to have: MAKEOPTS="-j13 -l2" This ensures the load on the local machine only goes to 2 and if available will use 13 threads.
(In reply to comment #2) > A good workaround for this issue is to have: MAKEOPTS="-j13 -l2" > This ensures the load on the local machine only goes to 2 and if available will > use 13 threads. Excellent point.
> (In reply to comment #2) > > A good workaround for this issue is to have: MAKEOPTS="-j13 -l2" > > This ensures the load on the local machine only goes to 2 and if available will > > use 13 threads. > > > Excellent point. > This deserves a note in the gentoo distcc docs. I still think there is room for improvement in handling of the MAKEOPTS variable. As an alternative to DISTCC_MAKEOPTS portage could determine the -j? value from the entries in /etc/distcc/hosts. on a side note I miss a RC_NEED variable in make.conf as I prefer not adding distccd to default on my laptop. This could also be used by people keeping portage in a squashfs image
Excellent info in comment 4! Now testing it... If that is it, can we probably check a bit the documentation and mark it FIXED. I just added some info to the Wiki: https://wiki.gentoo.org/wiki/Distcc#Setting_up_Portage_to_use_Distcc