[distcc] Re: PATH problem 2

Martin Pool mbp at samba.org
Fri Jul 11 07:46:41 GMT 2003


On 11 Jul 2003, Wayne Davison <wayned at users.sourceforge.net> wrote:
> I was imagining doing a pre-scan of the PATH, outputting the warnings to
> stderr before we detach so the user sees them right away (but only in
> non-inetd mode -- we'd have to use the log if inetd called us), and then
> just using the PATH and let the chips fall where they may.  
> 
> Re: your suggested execvp()-replacing algorithm -- a few issues come to
> mind:
> 
>  - Some people want to have distccd call ccache, so that needs to be
>    possible (somehow).

Yes, it's easy to leave that out, possibly by a server-side option.
Or indeed we could just go ahead and exec the first occurrence, even
if it's a link, and merely give a warning.

>  - Where would the warnings get output if they occurred at compiler-
>    exec time?  In the log I suppose?

A warning message at that point will go both to the client's stderr
(via the stderr catch file and SERR), and also into the daemon log.
In fact I think this is an advantage, because it makes it more visible.

>  - If someone had a PATH with colorgcc;ccache;distcc;bin on it, your
>    algorithm would not output any warnings and would hand off the
>    compilation to colorgcc.  In my suggested algorithm, it would warn
>    about the ccache and distcc dirs and also hand off the compilation
>    to colorgcc.

That's true that it would not give the warnings.

A problem with scanning the path past the first hit is that it
implicitly assumes that's what the program we execute might do.  (And
it's true for distcc and ccache.)  But it's not true for colorgcc,
which (in 1.3.2) is hardcoded to finding gcc in /usr/bin/gcc, unless
it's specified in a preference file or as argv[1].

(This is a simpler system that distcc and perhaps worth reconsidering
if PATH-related user confusion keeps occurring.)

> Perhaps a combination of the two ideas would be in order?  I.e.:
> 
>  1. Pre-scan the PATH, output warnings if we find a ccache or distcc
>     masquerade link for cc (if using PATH, not DISTCCD_PATH).
> 
>  2. At compiler exec time (if DISTCCD_PATH was not used), do our own PATH
>     scan and skip symlinks to ccache and/or distcc.

I guess we could scan the whole path at execution time, to catch this
case, and then go back and try to execute each of them.

-- 
Martin 



More information about the distcc mailing list