[buildbot] phase2: implement tree expiry, use CONFIG_AUTOREMOVE

LEDE Commits lede-commits at lists.infradead.org
Wed Jan 18 18:16:15 PST 2017


jow pushed a commit to buildbot.git, branch master:
https://git.lede-project.org/97fc2b1553f78300f5db58dd8fb4699b0bd3b1e5

commit 97fc2b1553f78300f5db58dd8fb4699b0bd3b1e5
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Thu Jan 19 03:14:02 2017 +0100

    phase2: implement tree expiry, use CONFIG_AUTOREMOVE
    
     - Implement option to expire the build tree after it reached its maximum age
     - Enable the CONFIG_AUTOREMOVE feature to keep build_dir small
     - Do not clobber pre-existing SDK directory when extracting newer SDK
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 phase2/master.cfg | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/phase2/master.cfg b/phase2/master.cfg
index b1d3860..08b5387 100644
--- a/phase2/master.cfg
+++ b/phase2/master.cfg
@@ -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()
 
@@ -234,6 +238,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",
@@ -251,7 +270,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", "--no-overwrite-dir", "--strip-components=1", "-C", "sdk/", "-vxf", "sdk.archive"],
 		haltOnFailure = True))
 
 	factory.addStep(FileDownload(mastersrc=home_dir+'/key-build', slavedest="sdk/key-build", mode=0600))
@@ -284,7 +303,7 @@ 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"]))
 
 	factory.addStep(ShellCommand(
 		name = "mkfeedsconf",



More information about the lede-commits mailing list