]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Skip bogus pump output in the preprocessed stdout
authorAnders Björklund <anders@psqr.se>
Sun, 30 Oct 2016 21:38:13 +0000 (22:38 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 25 Mar 2017 16:10:11 +0000 (17:10 +0100)
When using the distcc-pump wrapper, filter out the progress
information ('_' x 9) from the preprocessed source code...

ccache.c

index a5adea8a45e3b4874a19c0c9cb4977f0f536022f..26738d6fe32e713fdb409897565b11487b126afd 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -700,7 +700,7 @@ make_relative_path(char *path)
 // - Stores the paths and hashes of included files in the global variable
 //   included_files.
 static bool
-process_preprocessed_file(struct mdfour *hash, const char *path)
+process_preprocessed_file(struct mdfour *hash, const char *path, bool pump)
 {
        char *data;
        size_t size;
@@ -854,6 +854,19 @@ process_preprocessed_file(struct mdfour *hash, const char *path)
                        cc_log("Found unsupported .incbin directive in source code");
                        stats_update(STATS_UNSUPPORTED_DIRECTIVE);
                        failed();
+               } else if (pump && strncmp(q, "_________", 9) == 0) {
+                       // Unfortunately the distcc-pump wrapper outputs standard output lines:
+                       // __________Using distcc-pump from /usr/bin
+                       // __________Using # distcc servers in pump mode
+                       // __________Shutting down distcc-pump include server
+                       while (q < end && *q != '\n') {
+                               q++;
+                       }
+                       if (*q == '\n') {
+                               q++;
+                       }
+                       p = q;
+                       continue;
                } else {
                        q++;
                }
@@ -1470,7 +1483,7 @@ get_object_name_from_cpp(struct args *args, struct mdfour *hash)
                }
        } else {
                hash_delimiter(hash, "cpp");
-               if (!process_preprocessed_file(hash, path_stdout)) {
+               if (!process_preprocessed_file(hash, path_stdout, compiler_is_pump(args))) {
                        stats_update(STATS_ERROR);
                        failed();
                }