<div dir="ltr">Try to get the whitespace changes separately next time please.<div><br></div><div>Thanks!</div><div><br></div><div>-eric</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 28, 2013 at 2:05 PM, David Greene <span dir="ltr"><<a href="mailto:greened@obbligato.org" target="_blank">greened@obbligato.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: greened<br>
Date: Mon Jan 28 16:05:50 2013<br>
New Revision: 173723<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=173723&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=173723&view=rev</a><br>
Log:<br>
Avoid Unnecessary Builds<br>
<br>
By default, stop the universe build if a key component fails.  This<br>
avoids useless builds when we know a package is broken anyway.<br>
Provide a --keep-going option to override this behavior.<br>
<br>
Modified:<br>
    llvm/trunk/utils/llvm-compilers-check<br>
<br>
Modified: llvm/trunk/utils/llvm-compilers-check<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-compilers-check?rev=173723&r1=173722&r2=173723&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-compilers-check?rev=173723&r1=173722&r2=173723&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/utils/llvm-compilers-check (original)<br>
+++ llvm/trunk/utils/llvm-compilers-check Mon Jan 28 16:05:50 2013<br>
@@ -1,11 +1,11 @@<br>
 #!/usr/bin/python3<br>
 ##===- utils/llvmbuild - Build the LLVM project ----------------*-python-*-===##<br>
-#<br>
+#<br>
 #                     The LLVM Compiler Infrastructure<br>
 #<br>
 # This file is distributed under the University of Illinois Open Source<br>
 # License. See LICENSE.TXT for details.<br>
-#<br>
+#<br>
 ##===----------------------------------------------------------------------===##<br>
 #<br>
 # This script builds many different flavors of the LLVM ecosystem.  It<br>
@@ -147,6 +147,8 @@ def add_options(parser):<br>
                       help=("Do not build dragonegg"))<br>
     parser.add_option("--no-install", default=False, action="store_true",<br>
                       help=("Do not do installs"))<br>
+    parser.add_option("--keep-going", default=False, action="store_true",<br>
+                      help=("Keep going after failures"))<br>
     return<br>
<br>
 def check_options(parser, options, valid_builds):<br>
@@ -282,7 +284,7 @@ class Builder(threading.Thread):<br>
<br>
         for key, value in env.items():<br>
             execenv[key] = value<br>
-<br>
+<br>
         self.logger.debug("[" + prefix + "] " + "env " + str(env) + " "<br>
                           + " ".join(command));<br>
<br>
@@ -299,6 +301,11 @@ class Builder(threading.Thread):<br>
                                  + str(line, "utf-8").rstrip())<br>
                 line = proc.stdout.readline()<br>
<br>
+            (stdoutdata, stderrdata) = proc.communicate()<br>
+            retcode = proc.wait()<br>
+<br>
+            return retcode<br>
+<br>
         except:<br>
             traceback.print_exc()<br>
<br>
@@ -327,6 +334,7 @@ class Builder(threading.Thread):<br>
                     self.logger.debug("Start Gather")<br>
                     gather = True<br>
                 line = proc.stdout.readline()<br>
+<br>
         except:<br>
             traceback.print_exc()<br>
         self.logger.debug(includes)<br>
@@ -438,7 +446,7 @@ class Builder(threading.Thread):<br>
<br>
         for component in components:<br>
             comp = component[:]<br>
-<br>
+<br>
             if (self.options.no_dragonegg):<br>
                 if (comp == 'dragonegg'):<br>
                     <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Skipping " + component + " in "<br>
@@ -458,43 +466,74 @@ class Builder(threading.Thread):<br>
                                        "").split())<br>
<br>
             <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Configuring " + component + " in " + builddir)<br>
-            self.configure(component, srcdir, builddir,<br>
-                           config_args,<br>
-                           configure_env[comp_key][build])<br>
-<br>
-            <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Building " + component + " in " + builddir)<br>
-            <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Build: make " + str(make_flags[comp_key][build]))<br>
-            self.make(component, srcdir, builddir,<br>
-                      make_flags[comp_key][build],<br>
-                      make_env[comp_key][build])<br>
-<br>
-            if (not self.options.no_install):<br>
-                <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Installing " + component + " in " + installdir)<br>
-                self.make(component, srcdir, builddir,<br>
-                          make_install_flags[comp_key][build],<br>
-                          make_install_env[comp_key][build])<br>
-<br>
-            <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Testing " + component + " in " + builddir)<br>
-            <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Test: make "<br>
-                             + str(make_check_flags[comp_key][build]))<br>
-            self.make(component, srcdir, builddir,<br>
-                      make_check_flags[comp_key][build],<br>
-                      make_check_env[comp_key][build])<br>
+            configrc = self.configure(component, srcdir, builddir,<br>
+                                      config_args,<br>
+                                      configure_env[comp_key][build])<br>
+<br>
+            if (configrc == None) :<br>
+                <a href="http://self.logger.info" target="_blank">self.logger.info</a>("[None] Failed to configure " + component + " in " + installdir)<br>
+<br>
+            if (configrc == 0 or self.options.keep_going) :<br>
+                <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Building " + component + " in " + builddir)<br>
+                <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Build: make " + str(make_flags[comp_key][build]))<br>
+                buildrc = self.make(component, srcdir, builddir,<br>
+                                    make_flags[comp_key][build],<br>
+                                    make_env[comp_key][build])<br>
+<br>
+                if (buildrc == None) :<br>
+                    <a href="http://self.logger.info" target="_blank">self.logger.info</a>("[None] Failed to build " + component + " in " + installdir)<br>
+<br>
+                if (buildrc == 0 or self.options.keep_going) :<br>
+                    <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Testing " + component + " in " + builddir)<br>
+                    <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Test: make "<br>
+                                     + str(make_check_flags[comp_key][build]))<br>
+                    testrc = self.make(component, srcdir, builddir,<br>
+                                       make_check_flags[comp_key][build],<br>
+                                       make_check_env[comp_key][build])<br>
+<br>
+                    if (testrc == None) :<br>
+                        <a href="http://self.logger.info" target="_blank">self.logger.info</a>("[None] Failed to test " + component + " in " + installdir)<br>
+<br>
+                    if ((testrc == 0  or self.options.keep_going)<br>
+                        and not self.options.no_install):<br>
+                        <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Installing " + component + " in " + installdir)<br>
+                        self.make(component, srcdir, builddir,<br>
+                                  make_install_flags[comp_key][build],<br>
+                                  make_install_env[comp_key][build])<br>
+                    else :<br>
+                        <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Failed testing " + component + " in " + installdir)<br>
+<br>
+                else :<br>
+                    <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Failed to build " + component + " in " + installdir)<br>
<br>
+            else :<br>
+                <a href="http://self.logger.info" target="_blank">self.logger.info</a>("Failed to configure " + component + " in " + installdir)<br>
<br>
     def configure(self, component, srcdir, builddir, flags, env):<br>
+        prefix = self.component_abbrev[component.replace("-", "_")]<br>
+<br>
         self.logger.debug("Configure " + str(flags) + " " + str(srcdir) + " -> "<br>
                           + str(builddir))<br>
<br>
         configure_files = dict(<br>
             llvm=[(srcdir + "/configure", builddir + "/Makefile")],<br>
-            dragonegg=[("","")])<br>
+            dragonegg=[(None,None)])<br>
<br>
<br>
         doconfig = False<br>
         for conf, mf in configure_files[component.replace("-", "_")]:<br>
+            if conf is None:<br>
+                # No configure necessary<br>
+                return 0<br>
+<br>
             if not os.path.exists(conf):<br>
-                return<br>
+                <a href="http://self.logger.info" target="_blank">self.logger.info</a>("[" + prefix + "] Configure failed, no configure script " + conf)<br>
+                return -1<br>
+<br>
+            if not os.path.exists(mf):<br>
+                <a href="http://self.logger.info" target="_blank">self.logger.info</a>("[" + prefix + "] Configure failed, no makefile " + mf)<br>
+                return -1<br>
+<br>
             if os.path.exists(conf) and os.path.exists(mf):<br>
                 confstat = os.stat(conf)<br>
                 makestat = os.stat(mf)<br>
@@ -506,16 +545,17 @@ class Builder(threading.Thread):<br>
                 break<br>
<br>
         if not doconfig and not self.options.force_configure:<br>
-            return<br>
+            return 0<br>
<br>
         program = srcdir + "/configure"<br>
         if not is_executable(program):<br>
-            return<br>
+            <a href="http://self.logger.info" target="_blank">self.logger.info</a>("[" + prefix + "] Configure failed, cannot execute " + program)<br>
+            return -1<br>
<br>
         args = [program]<br>
         args += ["--verbose"]<br>
         args += flags<br>
-        self.execute(args, builddir, env, component)<br>
+        return self.execute(args, builddir, env, component)<br>
<br>
     def make(self, component, srcdir, builddir, flags, env):<br>
         program = find_executable("make")<br>
@@ -527,7 +567,7 @@ class Builder(threading.Thread):<br>
<br>
         args = [program]<br>
         args += flags<br>
-        self.execute(args, builddir, env, component)<br>
+        return self.execute(args, builddir, env, component)<br>
<br>
 # Global constants<br>
 build_abbrev = dict(debug="dbg", release="opt", paranoid="par")<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>