From 2b7ce04e3e2124c4591d2b76191f446bc9b22ac6 Mon Sep 17 00:00:00 2001 From: "fergus.henderson" Date: Tue, 4 May 2010 19:52:04 +0000 Subject: Apply patch from Ryan Burns : add an environment variable DISTCC_SKIP_LOCAL_RETRY for skipping the local retry in case of a remote compilation failure. git-svn-id: http://distcc.googlecode.com/svn/trunk@718 01de4be4-8c4a-0410-9132-4925637da917 --- man/distcc.1 | 4 ++++ src/compile.c | 23 +++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/man/distcc.1 b/man/distcc.1 index 2a0bcc4..556133d 100644 --- a/man/distcc.1 +++ b/man/distcc.1 @@ -785,6 +785,10 @@ Specifies the command used for opening SSH connections. Defaults to or "tsocks-ssh" that accepts a similar command line. The command is not split into words and is not executed through the shell. .TP +.B DISTCC_SKIP_LOCAL_RETRY +If set, when a remote compile fails, distcc will no longer try to +recompile that file locally. +.TP .B "DISTCC_DIR" Per-user configuration directory to store lock files and state files. By default diff --git a/src/compile.c b/src/compile.c index edd605d..29dec33 100644 --- a/src/compile.c +++ b/src/compile.c @@ -686,10 +686,25 @@ dcc_build_somewhere(char *argv[], fault, and we should do something about it later. (Currently, we send email to an appropriate email address). */ - rs_log_warning("remote compilation of '%s' failed, retrying locally", - input_fname); - remote_ret = ret; - goto fallback; + if (getenv("DISTCC_SKIP_LOCAL_RETRY")) { + /* dont retry locally. We'll treat the remote failure as + if it was a local one. But if we can't get the failures + then we need to retry regardless. + */ + if ((dcc_copy_file_to_fd(server_stderr_fname, STDERR_FILENO))) { + rs_log_warning("remote compilation of '%s' failed",\ + input_fname); + rs_log_warning("Could not show server-side errors, retrying locally"); + goto fallback; + } + /* Not retrying */ + goto clean_up; + } else { + rs_log_warning("remote compilation of '%s' failed, retrying locally", + input_fname); + remote_ret = ret; + goto fallback; + } } -- cgit v1.2.1