phase1: build local tar before running downloads
[buildbot.git] / phase1 / master.cfg
index 6030def4622d8117b90af1329f8795ba437c2be3..7e74bd39f7a0c438ff1d8b5bed547e67a1d99065 100644 (file)
@@ -141,23 +141,23 @@ from buildbot.steps.master import MasterShellCommand
 from buildbot.process.properties import WithProperties
 
 
-MakeTargetMap = {
-       "^tools/":                              "tools/clean",
-       "^toolchain/":                  "toolchain/clean",
-       "^target/linux/":               "target/linux/clean",
-       "^(config|include)/":   "dirclean"
-}
+CleanTargetMap = [
+       [ "tools",      "tools/clean"                   ],
+       [ "chain",      "toolchain/clean"               ],
+       [ "linux",      "target/linux/clean"    ],
+       [ "dir",        "dirclean"                              ],
+       [ "dist",       "distclean"                             ]
+]
 
-def IsAffected(pattern):
-       def CheckAffected(change):
-               for request in change.build.requests:
-                       for source in request.sources:
-                               for change in source.changes:
-                                       for file in change.files:
-                                               if re.match(pattern, file):
-                                                       return True
-               return False
-       return CheckAffected
+def IsCleanRequested(pattern):
+       def CheckCleanProperty(step):
+               val = step.getProperty("clean")
+               if val and re.match(pattern, val):
+                       return True
+               else:
+                       return False
+
+       return CheckCleanProperty
 
 
 c['builders'] = []
@@ -249,6 +249,15 @@ for target in targets:
                        haltOnFailure = True,
                        timeout = 2400))
 
+       # user-requested clean targets
+       for tuple in CleanTargetMap:
+               factory.addStep(ShellCommand(
+                       name = tuple[1],
+                       description = 'User-requested "make %s"' % tuple[1],
+                       command = ["make", tuple[1], "V=s"],
+                       doStepIf = IsCleanRequested(tuple[0])
+               ))
+
        # check out the source
        factory.addStep(Git(repourl=repo_url, mode='update'))
 
@@ -346,6 +355,14 @@ EOT''' %(ts[0], ts[0], ts[1]) ))
                want_stdout = False
        ))
 
+       # prepare tar
+       factory.addStep(ShellCommand(
+               name = "dltar",
+               description = "Building GNU tar",
+               command = ["make", WithProperties("-j%(nproc:~4)s"), "tools/tar/install", "V=s"],
+               haltOnFailure = True
+       ))
+
        # populate dl
        factory.addStep(ShellCommand(
                name = "dlrun",
@@ -361,14 +378,6 @@ EOT''' %(ts[0], ts[0], ts[1]) ))
                command=["make", "package/base-files/clean", "V=s"]
        ))
 
-       # optional clean steps
-       for pattern, maketarget in MakeTargetMap.items():
-               factory.addStep(ShellCommand(
-                       name = maketarget,
-                       description = maketarget,
-                       command=["make", maketarget, "V=s"], doStepIf=IsAffected(pattern)
-               ))
-
        # build
        factory.addStep(ShellCommand(
                name = "tools",