Browse Source

buildbot/master: use a helper generator for make cmd string list

Paul Jakma 2 years ago
parent
commit
671444d81b
1 changed files with 12 additions and 7 deletions
  1. 12 7
      infra/buildbot/master/master.cfg

+ 12 - 7
infra/buildbot/master/master.cfg

@@ -312,6 +312,11 @@ def get_config_env (props):
 		env = json.loads (jsonenv)
 	return env
 
+def makecmd (target):
+	if isinstance(target,basestring):
+		return [ "make", "-j", "2", target ]
+	return [ "make", "-j", "2" ] + target
+
 step_git = steps.Git(repourl=quaggagit, mode='incremental')
 step_autoconf = steps.ShellCommand(command=["./update-autotools"],
 			   description="generating autoconf",
@@ -323,7 +328,7 @@ git_and_autoconf = [
 	step_git, step_autoconf,
 ]
 step_configure = steps.Configure(command="../build/configure")
-step_clean = steps.ShellCommand(command=["make", "clean"],
+step_clean = steps.ShellCommand(command=makecmd("clean"),
 				description="cleaning",
 				descriptionDone="make clean")
 
@@ -336,8 +341,8 @@ factory = util.BuildFactory()
 
 factory.addSteps(common_setup)
 
-factory.addStep(steps.Compile(command=["make", "-j", "all"]))
-factory.addStep(steps.ShellCommand(command=["make", "-j", "check"],
+factory.addStep(steps.Compile(command=makecmd("all")))
+factory.addStep(steps.ShellCommand(command=makecmd("check"),
 				   description="checking",
 				   descriptionDone="make check"))
 
@@ -354,7 +359,7 @@ factory = util.BuildFactory()
 
 factory.addSteps(common_setup)
 
-factory.addStep(steps.ShellCommand(command=["make", "-j", "distcheck"],
+factory.addStep(steps.ShellCommand(command=makecmd("distcheck"),
 				   description="run make distcheck",
 				   descriptionDone="make distcheck"))
 c['builders'].append(
@@ -367,7 +372,7 @@ c['builders'].append(
 
 f = util.BuildFactory()
 
-factory.addSteps(common_setup)
+f.addSteps(common_setup)
 
 f.addStep(steps.SetProperty(property="clang-id",
 	value=util.Interpolate("%(prop:commit-description)s-%(prop:buildnumber)s")))
@@ -384,7 +389,7 @@ f.addStep(steps.Compile(command=["scan-build",
 			      	 "-analyze-headers",
 			      	 "-o",
 			      	 util.Interpolate("%(prop:clang-output-dir)s"),
-				 "make", "-j", "all"]))
+				 "make", "all"]))
 f.addStep(steps.DirectoryUpload(
 	  slavesrc=util.Interpolate("%(prop:clang-output-dir)s"),
 	  masterdest = util.Interpolate("%(prop:clang-upload-dir)s"),
@@ -412,7 +417,7 @@ f.addStep(steps.Git(repourl=quaggagit, mode='full'))
 f.addStep(step_autoconf)
 f.addStep(step_configure)
 
-f.addStep(steps.ShellCommand(command=["make", "dist"],
+f.addStep(steps.ShellCommand(command=makecmd("dist"),
 				     description="run make dist",
 				     descriptionDone="make dist"))
 # not imported somehow