summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfergus.henderson <fergushenderson@users.noreply.github.com>2010-05-04 19:52:04 +0000
committerfergus.henderson <fergushenderson@users.noreply.github.com>2010-05-04 19:52:04 +0000
commit7899ee33e9f41e5e1b33e22dce63d2422030c6a6 (patch)
tree08b77c6ae85ce0a6b0d4420eed801290b6bf0089
parentc03689163cd66abd44529fdb86b989a7dc7094a1 (diff)
downloaddistcc-git-7899ee33e9f41e5e1b33e22dce63d2422030c6a6.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.
-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;
+ }
}