[distcc] distccd paths

jason.davis at acterna.com jason.davis at acterna.com
Mon Oct 20 14:13:51 GMT 2003


I have gotten it to work successfully using the "shell script" method.
Basically what I do is add a farm directory to the beginning of the path.
In this directory I have some shell scripts named dist-gcc, dist-g++,
dist-arm-linux-gcc, etc.  When the user wants distributed build enabled, I
cp those scripts to gcc,g++,arm-linux-gcc, etc.  This seems to work well.
The only issue I have seen when passing the absolute path to distcc is that
if that path doesn't exist on a machine on your farm, your compile will
fail (it doesn't attempt to do it locally).  If I just disable the farm
entirely on the remote machine, it falls back correctly.  Is there a reason
for this?





                                                                                                                                       
                      Martin Pool                                                                                                      
                      <mbp at samba.org>          To:       jason.davis at acterna.com                                                       
                                               cc:       distcc at lists.samba.org                                                        
                      10/15/2003 09:55         Subject:  Re: [distcc] distccd paths                                                    
                      PM                                                                                                               
                                                                                                                                       
                                                                                                                                       




On 15 Oct 2003, jason.davis at acterna.com wrote:

> Our build environment contains multiple compilers with the same name,
> installed in different directories.

I find that kind of thing leads often leads to confusion and incorrect
builds...

> Only one of these compilers is used by a particular developer at a
> time (so doing the client side of distcc would seem to work using
> masquerading), but how does distccd know which compiler to use?

The client simply passes the compiler name.  If you say

  distcc /usr/local/gcc-3.1415-wibble/bin/gcc

then it passes that absolute path; otherwise it is just the basename.

> Is the entire path to the compiler passed to the server, or does it
> use PATH and/or DISTCCD_PATH to look for the appropriate executable?

The second.

Your options are

 - Use fully-qualified compiler names, with an arch, version, and
   whatever other variables you need.  I don't know how hard this will
   be on your build system but it is often the best long-term outcome,
   not just for distcc but also in preventing bugs and confusion.

 - Don't use masquerading, and pass the compiler's full path to
   distcc as above.

 - Write a little shell script which does

   exec distcc /usr/local/gcc-3.1415-wibble/bin/gcc "$@"

   and use that as your compiler

 - Run different daemons on different ports with different
   DISTCCD_PATH settings.  Use a different hosts definition for each
   build.  Kind of kludgy but you wouldn't need to change anything in
   your build system.

Please let us know how it works out.
--
Martin








More information about the distcc mailing list