FS#64275 - [devtools] [distcc] compiling linux with distcc using makepkg fails to distribute jobs

Attached to Project: Arch Linux
Opened by John (graysky) - Saturday, 26 October 2019, 16:02 GMT
Last edited by Andreas Radke (AndyRTR) - Tuesday, 04 May 2021, 16:00 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Compiling the linux package (5.3.7-arch1-2-ARCH) via makepkg with distcc enabled in /etc/makepkg.conf fails to distribute out jobs via distcc as it should. By contrast, I can compile the linux source without makepkg using distcc and jobs are distrubuted out via distcc as expected.

I am thinking that there must be something in makepkg itself or within its helper scripts that is causing the failure. I am not expert but it seem that /usr/share/makepkg/buildenv/compiler.sh is asking the build to use distcc via a PATH modification which could be to blame.

For example, to mimic makepkg's call to distcc I did this experiment from the shell and confirmed that it does NOT work with distcc:
% export DISTCC_HOSTS="localhost/9 10.9.8.112/5"
% export PATH="/usr/lib/distcc/bin:$PATH"
% make -j15 bzImage

By contrast, from the distcc man page, I used this stanza and it does work as expected:
% export DISTCC_HOSTS="localhost/9 10.9.8.112/5"
% make -j15 bzImage CC=distcc


I attached:
* The makepkg.conf I am using
* A log showing the errors from the makepkg build
* A distccd log on the volunteer machine also showing errors that are not present when building without makepkg

Please let me know what else I can provide.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Tuesday, 04 May 2021, 16:00 GMT
Reason for closing:  None
Additional comments about closing:  see comments
Comment by John (graysky) - Saturday, 26 October 2019, 16:55 GMT
EDIT: If I edit the official linux PKGBUILD appending a literal 'CC=distcc CXX=distcc', building with makepkg and distcc work as expected.

-make bzImage modules htmldocs
+make bzImage modules htmldocs CC=distcc CXX=distcc

According to the distcc man page, one should pass the CC=distcc variable as part of the build command[1].

1. https://github.com/distcc/distcc/blob/master/man/distcc.1#L116
Comment by John (graysky) - Saturday, 19 December 2020, 01:21 GMT
Probably safe to close this now. I updated the wiki with an explaination of why it happens and provided several work arounds. See: https://wiki.archlinux.org/index.php?title=Distcc&type=revision&diff=645909&oldid=645908
Comment by John (graysky) - Saturday, 06 March 2021, 11:06 GMT
Probably safe to close. Solution to building linux kernel in a clean chroot is to add the following line to the PKGBUILD before building:

sed -i '/HAVE_GCC_PLUGINS/d' arch/x86/Kconfig

Loading...