]> code.ossystems Code Review - openembedded-core.git/commitdiff
buildstats: Fix tracebacks for early task failures
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Apr 2016 13:53:14 +0000 (14:53 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 Apr 2016 05:57:48 +0000 (06:57 +0100)
If a failure occurs early in the task, its possible we can have a
TaskFailed before the TaskStarted event can be triggered. This in
turn causes another traceback as the directory buildstats writes
files into doesn't exist.

Ensure the directory exists so we can see the original error.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/buildstats.bbclass

index 2d63589e4b94bbf2bea543618c45325df1322ec1..34ecb0386144c2e3d7912ae2cc6c6032b2b62023 100644 (file)
@@ -167,6 +167,8 @@ python run_buildstats () {
                 f.write("Uncompressed Rootfs size: %s" % rootfs_size)
 
     elif isinstance(e, bb.build.TaskFailed):
+        # Can have a failure before TaskStarted so need to mkdir here too
+        bb.utils.mkdirhier(taskdir)
         write_task_data("failed", os.path.join(taskdir, e.task), e, d)
         ########################################################################
         # Lets make things easier and tell people where the build failed in