Skip to contentSkip to conversation

buildstats: Fix trackbacks for early task failures

PATCH New Richard Purdie 1 participant 1 message Apr 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildstats: Fix trackbacks for early task failures

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.

meta/classes/buildstats.bbclass +2 -0
index d381c93..ab72af5 100644
@@ -195,6 +195,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