[distcc] distcc-over-ssh!

Martin Pool mbp at samba.org
Wed Apr 2 07:23:41 GMT 2003

On  1 Apr 2003, Wayne Davison <wayned at users.sourceforge.net> wrote:

> One thing I noticed (in both the ssh and non-ssh version) is that distcc
> says that to be executing "gcc -E" twice.  Should that be happening?  I
> haven't noticed this before, but that doesn't mean it's new.  I'm just
> running "distcc gcc -c foo.c" with a single remote host in

I think this is caused by an interaction with masquerade mode.  The
command you're giving is detected in main() as not being masqueraded,
so the PATH is not modified.  

When distcc goes to run "gcc -E", it probably runs the one in
/usr/lib/distcc.  This invocation of distcc *will* see itself as
masqueraded, so it all works out in the end but it's a bit inefficient
and confusing.  Presumably ccache runs twice too.

I suppose the non-masqueraded client needs to strip its path in a
similar way to your patch for distccd.  Now that I know what's
happening here I think I'll put that in soon.

> distcc[17903] (dcc_recursion_safeguard) safeguard level=0
> distcc[17903] (dcc_trace_argv) scanning arguments: gcc -c foo.c
> distcc[17903] (dcc_scan_args) found input file "foo.c"
> distcc[17903] (dcc_scan_args) no visible output file, going to add "-o foo.o" at end
> distcc[17903] compile from foo.c to foo.o
> distcc[17903] (dcc_parse_hosts) found tcp token "home:4269"
> distcc[17903] (dcc_lock_host) got cpu lock on home slot 0
> distcc[17903] (dcc_lock_host) got xmit lock on home slot 0
> distcc[17903] (dcc_trace_argv) result: gcc -c foo.c
> distcc[17903] (dcc_trace_argv) forking to execute: gcc -E foo.c
> distcc[17903] (dcc_spawn_child) child started as pid17904
> distcc[17903] (dcc_trace_argv) result: gcc -c foo.c -o foo.o
> distcc[17903] exec on home: gcc -c foo.c -o foo.o
> distcc[17904] (dcc_inside_child) setting safeguard: _DISTCC_SAFEGUARD=1
> distcc[17904] (dcc_recursion_safeguard) safeguard: 1
> distcc[17904] (dcc_recursion_safeguard) safeguard level=1
> distcc[17904] (dcc_set_path) setting PATH=...trimmed...
> distcc[17904] exec on localhost: gcc -E foo.c
> distcc[17904] (dcc_trace_argv) forking to execute: gcc -E foo.c
> distcc[17905] (dcc_inside_child) setting safeguard: _DISTCC_SAFEGUARD=2
> distcc[17904] (dcc_spawn_child) child started as pid17905


More information about the distcc mailing list