cbuildbot: Make sure archive directory is created if it is needed.

The local archive directory was only being created for the top run (as
opposed to child runs).  This change makes sure an archive directory is
created for each of the child runs involved as well.

Then, if no archive directory is present before the Report stage runs,
for any reason, it is created then.

BUG=chromium:342183
TEST=unittest
TEST=`cbuildbot --remote --buildot --debug parrot-canary`

Change-Id: I806b91200087ad541b432b18c3afc76842144938
Reviewed-on: https://chromium-review.googlesource.com/185644
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Matt Tennant <mtennant@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 0e82d9e..a6bf144 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -179,6 +179,9 @@
     else:
       self._run.attrs.release_tag = None
 
+    cros_build_lib.Debug('Saved release_tag value for run: %r',
+                         self._run.attrs.release_tag)
+
   def _RunStage(self, stage, *args, **kwargs):
     """Wrapper to run a stage.
 
@@ -200,9 +203,6 @@
     finally:
       self._SetReleaseTag()
 
-    # Set up local archive directory for this run, now that we have a version.
-    self._run.GetArchive().SetupArchivePath()
-
   def GetSyncInstance(self):
     """Returns an instance of a SyncStage that should be run.
 
@@ -512,6 +512,9 @@
 
     tasks = []
     for builder_run in builder_runs:
+      # Prepare a local archive directory for each "run".
+      builder_run.GetArchive().SetupArchivePath()
+
       for board in builder_run.config.boards:
         archive_stage = self._GetStageInstance(
             stages.ArchiveStage, board, builder_run=builder_run,