Subject: distcc and pkgsrc
To: NetBSD Help <netbsd-help@netbsd.org>
From: Jarmo Jaakkola <jarmo.jaakkola@tut.fi>
List: netbsd-help
Date: 02/03/2006 20:58:19
Hi!

Today I installed devel/distcc (2.18.3nb1, running NetBSD 2.1) and
thought I could use all my boxes as help in building packages for
myself.  However, I seem to have stumbled upon some problems, which
I cannot figure out.

First let me explain the setup I have this far:
  - three computers: host1 800 MHz, host2 433MHz and host3 233MHz.
  - all disks are local on host1.  host2 and host3 boot over network
    and use NFS.
  - host1 has the following in /etc/mk.conf
        MAKEFLAGS=-j6
        PKGSRC_COMPILER=distcc gcc
    and the following is set in the environment:
        DISTCC_HOSTS=localhost host2 host3
  - all hosts are running distccd (also host1 just in case I'd someday
    like to build on host2 or host3)

Then I try to build packages in pkgsrc and they fail in various ways.
I tried to build shells/zsh and it once failed with "cannot make
headers" or something similar and once it went
    cc -c -I.  -DHAVE_CONFIG_H -O2 -o main.o ./main.c
    1 error
and died.

I also tried to build slrn and couple of times it seemed to get
stuck somewhere before it even got to compiling and once it compiled
all right, but stuck looping the question for root password ("becoming
root for install.. interrupted by signal 22" or something), never
showing the password prompt.

x11/xsnow managed to compile and install OK but as was with all the
others, distcc seemed to bring no additional speed-up.

For what I have witnessed, distcc never contacts any other hosts than
the first one in DISTCC_HOSTS, at least for those three example
packages I have tried.

And now for the actual questions:

1) Is there something in the configuration I have missed?  -jN is
   the way to get make(1) utilize distcc(1)'s parallelism , right?

2) Are there some incompatibilities so that only some packages compile
   with distcc?  How can I tell which?

3) How can I make distcc contact other hosts than the first one?  Or
   is the problem in the makefiles?  I.e. all files form only one long
   chain a -> b -> c -> d -> ad nauseam, thus forcing serialized build.

Pointers to documents discussing NetBSD, pkgsrc and distcc would be
also welcome.

-- 
 Jarmo Jaakkola