]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Allow the pump wrapper from distcc to use stdout
authorAnders Björklund <anders@psqr.se>
Sun, 30 Oct 2016 21:22:27 +0000 (22:22 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 25 Mar 2017 16:10:11 +0000 (17:10 +0100)
The shell wrapper for "distcc-pump" outputs some useless progress
information to stdout. Let it do that without failing the compile.

ccache.c

index 9fbbdd7d42b4ec135513c81faca7d4ff5a81566a..a5adea8a45e3b4874a19c0c9cb4977f0f536022f 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1069,6 +1069,15 @@ void update_manifest_file(void)
        }
 }
 
+static bool
+compiler_is_pump(struct args *args)
+{
+       char *name = basename(args->argv[0]);
+       bool result = str_eq(name, "pump") || str_eq(name, "distcc-pump");
+       free(name);
+       return result;
+}
+
 // Run the real compiler and put the result in cache.
 static void
 to_cache(struct args *args)
@@ -1160,7 +1169,8 @@ to_cache(struct args *args)
                }
                failed();
        }
-       if (st.st_size != 0) {
+       // distcc-pump outputs lines like "__________Using # distcc servers in pump mode"
+       if (st.st_size != 0 && !compiler_is_pump(args)) {
                cc_log("Compiler produced stdout");
                stats_update(STATS_STDOUT);
                tmp_unlink(tmp_stdout);