summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2010-05-04 19:52:04 +0000
committerfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2010-05-04 19:52:04 +0000
commit2b7ce04e3e2124c4591d2b76191f446bc9b22ac6 (patch)
tree08b77c6ae85ce0a6b0d4420eed801290b6bf0089
parent677b047213a50b263ae36febf90a1515d3aab75a (diff)
downloaddistcc-2b7ce04e3e2124c4591d2b76191f446bc9b22ac6.tar.gz
Apply patch from Ryan Burns <rburns@pixar.com>:
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
-rw-r--r--man/distcc.14
-rw-r--r--src/compile.c23
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;
+ }
}