FS#24850 - [pacman] makepkg does not use distcc but make does

Attached to Project: Pacman
Opened by John (graysky) - Thursday, 23 June 2011, 20:02 GMT
Last edited by Dan McGee (toofishes) - Friday, 24 June 2011, 20:44 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version 3.5.3
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

pacman 3.5.3-1
distcc-3.1-3

Summary and Info: I configured /etc/makepkg.conf to use distcc but as I monitor the build in distccmon-text, none of the work is being alloted to my other server when queued via makepkg. It does however from the shell using make (manually). Test package I am compiling is kernel26 from ABS which is know to work with distcc.

Setup Details:
*Both machines have distcc from [community] installed and distccd daemon is running on both machines.
*Both machines have the following entry in /etc/hosts.allow: distccd: 192.168.0.

Server PC (dual core on 192.168.0.3):
------------------
/etc/conf.d/distccd contains
DISTCC_ARGS="--user nobody --allow 192.168.0.2"


Daemon PC (quad core on 192.168.0.2):
------------------

/etc/makepkg.conf has been modified follows:

MAKEFLAGS="-j7"
BUILDENV=(distcc fakeroot color !ccache check)
DISTCC_HOSTS="192.168.0.3" # this is the server PCs IP

I start a makepkg -s and look at distccmon-text as it is compiling to see:

$ distccmon-text
586 Blocked [0]
576 Blocked [0]
573 Blocked [0]
920 Compile localhost[0]
953 Compile localhost[1]
936 Compile localhost[2]
944 Compile localhost[3]

This is in stark contrast to when I do the following from a shell:

$ export DISTCC_HOSTS='localhost/5 192.168.0.32/3'
$ make bzImage -j7 CC=distcc

Now once the compile starts going:

$ distccmon-text
17826 Blocked [0]
17747 Compile skbuff.c 192.168.0.3[2]
17800 Compile scatterlist.c 192.168.0.3[4]
17784 Compile compat.c localhost[0]
17810 Compile array.c localhost[1]
17692 Compile erst.c localhost[2]
17815 Compile random.c localhost[3]
This task depends upon

Closed by  Dan McGee (toofishes)
Friday, 24 June 2011, 20:44 GMT
Reason for closing:  Works for me
Comment by John (graysky) - Thursday, 23 June 2011, 20:03 GMT
There is a typeo in my export line:

$ export DISTCC_HOSTS='localhost/5 192.168.0.32/3' SHOULD BE
$ export DISTCC_HOSTS='localhost/5 192.168.0.3/3'

But you get the idea.
Comment by Dan McGee (toofishes) - Thursday, 23 June 2011, 20:24 GMT
I don't think many of us use this, so you're going to have to help us out a bit. Why are you using different DISTCC_HOSTS lines for manual vs. makepkg?

For using the distcc compiler, we simply add /usr/lib/distcc/bin to the front of the PATH, and do not override the compiler setting. What happens if you try to do it this way manually?

[[ -d /usr/lib/distcc/bin ]] && export PATH="/usr/lib/distcc/bin:$PATH"
export DISTCC_HOSTS

then make as normal, no compiler specified.
Comment by John (graysky) - Thursday, 23 June 2011, 20:48 GMT
@Dan - I used different settings manually simply because the /# seems to be required to tell the software how many jobs should be queued to that particular host. If I omit it, the dualcore host gets 4-5 jobs and the quad gets 1-2! Also, I was following the distcc docs as a sanity check for me.

So I just did this:

$ [[ -d /usr/lib/distcc/bin ]] && export PATH="/usr/lib/distcc/bin:$PATH"
$ export DISTCC_HOSTS

But when I confirmed the variable, it was null:
$ echo $DISTCC_HOSTS

I then run the make line but the output was full of errors complaining:

$ time make bzImage -j7
CHK include/linux/version.h
HOSTCC scripts/basic/fixdep
CHK include/generated/utsrelease.h
HOSTCC scripts/basic/docproc
CC kernel/bounds.s
distcc[21490] (dcc_parse_hosts) Warning: /etc/distcc/hosts contained no hosts; can't distribute work
distcc[21490] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
Comment by Dan McGee (toofishes) - Thursday, 23 June 2011, 20:54 GMT
The EXPORT line doesn't do any good if you don't set the variable first...I was just pulling lines out of makepkg to show you what it does. You need to set the variable, then run the export.
Comment by John (graysky) - Thursday, 23 June 2011, 21:00 GMT
If I do this:

$ [[ -d /usr/lib/distcc/bin ]] && export PATH="/usr/lib/distcc/bin:$PATH"
$ . /etc/makepkg.conf
$ time make bzImage -j7

I get the same errors.

However, if I modify the line in /etc/makepkg.conf from this:
DISTCC_HOSTS="192.168.0.3"

to this:
DISTCC_HOSTS="192.168.0.2/5 192.168.0.3/3"

The makepkg results is the same as before EXCEPT there are way more than 5 threads for it and the three that are supposed to go to 192.168.0.3 are still "blocked":

$ distccmon-text
18361 Blocked [0]
17119 Blocked [0]
17113 Blocked [0]
18598 Compile localhost[0]
18575 Compile localhost[0]
18539 Compile localhost[0]
18526 Compile localhost[0]
18525 Compile localhost[0]
18597 Compile localhost[1]
18538 Compile localhost[2]
18574 Compile localhost[3]

Interestingly, if I open a fresh shell, and compile manually as you suggested + sourcing same /etc/makepkg.conf as I just used, everything works! See:

$ [[ -d /usr/lib/distcc/bin ]] && export PATH="/usr/lib/distcc/bin:$PATH"
$ . /etc/makepkg.conf
$ echo $DISTCC_HOSTS
192.168.0.2/5 192.168.0.3/3
$time make bzImage -j7

$ distccmon-text
22286 Preprocess probe_64.c 192.168.0.2[0]
22276 Compile apic_noop.c 192.168.0.2[0]
22250 Compile kfifo.c 192.168.0.2[0]
22256 Compile blk-core.c 192.168.0.2[1]
22195 Compile block_dev.c 192.168.0.3[1]
22263 Compile compat.c 192.168.0.3[2]
22091 Compile hugetlb.c 192.168.0.3[3]

Seems like the problem is somehow inside /usr/bin/makepkg
?
Comment by Dave Reisner (falconindy) - Thursday, 23 June 2011, 21:27 GMT
I'll add a "works for me".

$ distccmon-text
7370 Compile conflict.c 10.0.2.121[2]
7277 Compile alpm.c 10.0.2.121[2]
7279 Compile backup.c 10.0.2.121[4]
7387 Compile be_local.c 10.0.2.148[0]
7363 Compile add.c 10.0.2.148[1]
7377 Compile be_sync.c 10.0.2.148[3]

Note that I'm setting the --allow parameter to be my entire subnet (--allow 10.0.2.0/24), and im always specifying the LAN IP (never localhost) in DISTCC_HOSTS.
Comment by Dan McGee (toofishes) - Thursday, 23 June 2011, 21:31 GMT
Neither Dave nor I can reproduce this- you're going to have to dig into the problem on your own if you want to resolve it, I don't know what else to tell you. Please try something other than a kernel to test it out to make sure it isn't related to your PKGBUILD.
Comment by John (graysky) - Thursday, 23 June 2011, 21:49 GMT
@falconindy - I adjusted the --allow to the entire subnet (192.168.0.0/24) and in /etc/makepkg.conf the DISTCC_HOST are the LAN IP addresses. Is the example you posted above from a makepkg -s or from a manual make run? Also, can a sanity check for me can you post:

/etc/hosts.allow
/etc/conf.d/distccd
/etc/makepkg.conf

I'm going a bit crazy with this not working :)

Also, what package did you compile in your example above? I will attempt to repeat with it.
Comment by Dave Reisner (falconindy) - Thursday, 23 June 2011, 22:00 GMT
This was via makepkg using pacman-git as a test victim.

hosts.allow doesn't come into this as tcp wrappers is not involved.
Comment by John (graysky) - Thursday, 23 June 2011, 22:08 GMT
Thanks for the info. Same result on my machine with pacman-git :(

Can you post your /etc/makepkg.conf
Comment by Dave Reisner (falconindy) - Friday, 24 June 2011, 00:47 GMT
Relevant bits:

# makepkg.conf (from the master)
MAKEFLAGS="-j8"
BUILDENV=(fakeroot distcc color !ccache check)
DISTCC_HOSTS="10.0.2.121/4 10.0.2.148/4"

# /etc/conf.d/distccd (from BOTH machines)
DISTCC_ARGS="--user nobody --allow 10.0.2.0/24"
Comment by John (graysky) - Friday, 24 June 2011, 08:23 GMT
Thanks! Just line mine :( I plan to tar up this installation and install fresh to repeat since there is no reason I can thing of for the behavior on my system. I'll let you guys know and thank you both for the time you've spent on this for me :)
Comment by John (graysky) - Friday, 24 June 2011, 20:44 GMT
Reinstall fixed the problem... probably something in one of my configs or some other pilot error! Thanks again!

Loading...