phase2: --keep-newer-files and --no-overwrite-dir are exclusive
[buildbot.git] / phase2 / master.cfg
index c711b09deeb7a9db47731f4365a4a9dfe91861bb..20ff19ed9c2e8a2c7f5a6343c977a70641c67984 100644 (file)
@@ -30,6 +30,7 @@ from buildbot.buildslave import BuildSlave
 slave_port = 9990
 persistent = False
 other_builds = 0
+tree_expire = 0
 
 if ini.has_option("general", "port"):
        slave_port = ini.getint("general", "port")
@@ -40,6 +41,9 @@ if ini.has_option("general", "persistent"):
 if ini.has_option("general", "other_builds"):
        other_builds = ini.getint("general", "other_builds")
 
+if ini.has_option("general", "expire"):
+       tree_expire = ini.getint("general", "expire")
+
 c['slaves'] = []
 max_builds = dict()
 
@@ -61,6 +65,10 @@ c['slavePortnum'] = slave_port
 # coalesce builds
 c['mergeRequests'] = True
 
+# Reduce amount of backlog data
+c['buildHorizon'] = 30
+c['logHorizon'] = 20
+
 ####### CHANGESOURCES
 
 home_dir = os.path.abspath(ini.get("general", "homedir"))
@@ -190,6 +198,14 @@ def GetNumJobs(props):
        else:
                return 1
 
+def GetCwd(props):
+       if props.hasProperty("builddir"):
+               return props["builddir"]
+       elif props.hasProperty("workdir"):
+               return props["workdir"]
+       else:
+               return "/"
+
 
 c['builders'] = []
 
@@ -230,6 +246,21 @@ for arch in arches:
                        haltOnFailure = True,
                        timeout = 2400))
 
+       # expire tree if needed
+       elif tree_expire > 0:
+               factory.addStep(FileDownload(
+                       mastersrc = home_dir+"/expire.sh",
+                       slavedest = "../expire.sh",
+                       mode = 0755))
+
+               factory.addStep(ShellCommand(
+                       name = "expire",
+                       description = "Checking for build tree expiry",
+                       command = ["./expire.sh", str(tree_expire)],
+                       workdir = ".",
+                       haltOnFailure = True,
+                       timeout = 2400))
+
        factory.addStep(ShellCommand(
                name = "mksdkdir",
                description = "Preparing SDK directory",
@@ -247,7 +278,7 @@ for arch in arches:
        factory.addStep(ShellCommand(
                name = "unpacksdk",
                description = "Unpacking SDK archive",
-               command = ["tar", "--strip-components=1", "-C", "sdk/", "-vxf", "sdk.archive"],
+               command = ["tar", "--keep-newer-files", "--strip-components=1", "-C", "sdk/", "-vxf", "sdk.archive"],
                haltOnFailure = True))
 
        factory.addStep(FileDownload(mastersrc=home_dir+'/key-build', slavedest="sdk/key-build", mode=0600))
@@ -264,6 +295,17 @@ for arch in arches:
                workdir = "build/sdk",
                command = ["sh", "-c", "rm -f .config && make defconfig"]))
 
+       factory.addStep(FileDownload(
+               mastersrc = home_dir+'/ccache.sh',
+               slavedest = 'sdk/ccache.sh',
+               mode = 0755))
+
+       factory.addStep(ShellCommand(
+               name = "prepccache",
+               description = "Preparing ccache",
+               workdir = "build/sdk",
+               command = ["./ccache.sh"]))
+
        factory.addStep(ShellCommand(
                name = "updatefeeds",
                description = "Updating feeds",
@@ -280,7 +322,14 @@ for arch in arches:
                name = "compile",
                description = "Building packages",
                workdir = "build/sdk",
-               command = ["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "V=s", "IGNORE_ERRORS=n m y", "BUILD_LOG=1", "CONFIG_SIGNED_PACKAGES=y"]))
+               command = ["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "IGNORE_ERRORS=n m y", "BUILD_LOG=1", "CONFIG_SIGNED_PACKAGES=y", "CONFIG_AUTOREMOVE=y"],
+               env = {'CCACHE_BASEDIR': WithProperties("%(cwd)s", cwd=GetCwd)}))
+
+       factory.addStep(ShellCommand(
+               name = "mkfeedsconf",
+               description = "Generating pinned feeds.conf",
+               workdir = "build/sdk",
+               command = "./scripts/feeds list -s -f > bin/packages/%s/feeds.conf" %(arch[0])))
 
        if gpg_keyid is not None:
                factory.addStep(MasterShellCommand(
@@ -340,7 +389,7 @@ for arch in arches:
                name = "packageupload",
                description = "Uploading package files",
                workdir = "build/sdk",
-               command = ["rsync", "--delete", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-avz", "bin/packages/%s/" %(arch[0]), WithProperties("%s/packages%%(suffix)s/%s/" %(rsync_bin_url, arch[0]), suffix=GetDirectorySuffix)],
+               command = ["rsync", "--progress", "--delete", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-avz", "bin/packages/%s/" %(arch[0]), WithProperties("%s/packages%%(suffix)s/%s/" %(rsync_bin_url, arch[0]), suffix=GetDirectorySuffix)],
                env={'RSYNC_PASSWORD': rsync_bin_key},
                haltOnFailure = True,
                logEnviron = False
@@ -376,7 +425,7 @@ for arch in arches:
                name = "logupload",
                description = "Uploading failure logs",
                workdir = "build/sdk",
-               command = ["rsync", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-avz", "faillogs/", "%s/faillogs/%s/" %(rsync_bin_url, arch[0])],
+               command = ["rsync", "--progress", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-avz", "faillogs/", "%s/faillogs/%s/" %(rsync_bin_url, arch[0])],
                env={'RSYNC_PASSWORD': rsync_bin_key},
                haltOnFailure = False,
                logEnviron = False
@@ -387,7 +436,7 @@ for arch in arches:
                        name = "sourceupload",
                        description = "Uploading source archives",
                        workdir = "build/sdk",
-                       command = ["rsync", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-avz", "dl/", "%s/" %(rsync_src_url)],
+                       command = ["rsync", "--progress", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-avz", "dl/", "%s/" %(rsync_src_url)],
                        env={'RSYNC_PASSWORD': rsync_src_key},
                        haltOnFailure = False,
                        logEnviron = False