[PATCH] D45295: report error messages in annotated_builder.py

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 15:44:00 PDT 2018


inglorion created this revision.
inglorion added reviewers: gkistanova, hans, rnk.

annotated_builder.py's report_step_exception() function would emit a
buildbot @@@STEP_EXCEPTION@@@ annotation, but had no way to report an
error message. This change adds that functionality and makes
annotated_builder.py use it. I also spotted and removed a redundant
check around a call to util.clean_dir().


https://reviews.llvm.org/D45295

Files:
  zorg/buildbot/builders/annotated/annotated_builder.py


Index: zorg/buildbot/builders/annotated/annotated_builder.py
===================================================================
--- zorg/buildbot/builders/annotated/annotated_builder.py
+++ zorg/buildbot/builders/annotated/annotated_builder.py
@@ -35,7 +35,9 @@
     def report_build_step(self, step):
         util.report('@@@BUILD_STEP %s@@@' % (step,))
 
-    def report_step_exception(self):
+    def report_step_exception(self, exn=None):
+        if exn:
+            util.report(str(exn))
         util.report('@@@STEP_EXCEPTION@@@')
 
     def build_and_check_stage(
@@ -123,10 +125,9 @@
         self.halt_on_failure()
         try:
             util.clean_dir(build_dir)
-        except OSError as e:
-            if e.errno != errno.ENOENT:
-                self.report_step_exception()
-                raise
+        except Exception as e:
+          self.report_step_exception(e)
+          raise
 
     def cmake(
         self,
@@ -233,8 +234,8 @@
 
             for var in sorted(os.environ.keys()):
                 util.report('%s=%s' % (var, os.environ[var]))
-        except:
-            self.report_step_exception()
+        except Exception as e:
+            self.report_step_exception(e)
             raise
 
     def update_sources(self, source_dir, projects, revision=None, svn='svn'):
@@ -258,8 +259,8 @@
                     util.mkdirp(path)
                     cmd = [svn, 'co'] + revision_args + [uri, '.']
                 util.report_run_cmd(cmd, cwd=path)
-        except:
-            self.report_step_exception()
+        except Exception as e:
+            self.report_step_exception(e)
             raise
 
     def run_steps(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45295.141076.patch
Type: text/x-patch
Size: 1669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180404/ba65257f/attachment.bin>


More information about the llvm-commits mailing list