####### CHANGESOURCES
+branchNames = [branches[b]["name"] for b in branches]
# find targets
-targets = [ ]
+targets = set()
def populateTargets():
+ log.msg("Populating targets, this will take time")
sourcegit = work_dir + '/source.git'
- if os.path.isdir(sourcegit):
- subprocess.call(["rm", "-rf", sourcegit])
+ for branch in branchNames:
+ if os.path.isdir(sourcegit):
+ subprocess.call(["rm", "-rf", sourcegit])
- subprocess.call(["git", "clone", "--depth=1", "--branch="+repo_branch, repo_url, sourcegit])
+ subprocess.call(["git", "clone", "--depth=1", "--branch="+branch, repo_url, sourcegit])
- os.makedirs(sourcegit + '/tmp', exist_ok=True)
- findtargets = subprocess.Popen(['./scripts/dump-target-info.pl', 'targets'],
- stdout = subprocess.PIPE, stderr = subprocess.DEVNULL, cwd = sourcegit)
+ os.makedirs(sourcegit + '/tmp', exist_ok=True)
+ findtargets = subprocess.Popen(['./scripts/dump-target-info.pl', 'targets'],
+ stdout = subprocess.PIPE, stderr = subprocess.DEVNULL, cwd = sourcegit)
- while True:
- line = findtargets.stdout.readline()
- if not line:
- break
- ta = line.decode().strip().split(' ')
- targets.append(ta[0])
+ while True:
+ line = findtargets.stdout.readline()
+ if not line:
+ break
+ ta = line.decode().strip().split(' ')
+ targets.add(ta[0])
- subprocess.call(["rm", "-rf", sourcegit])
+ subprocess.call(["rm", "-rf", sourcegit])
populateTargets()
name = "all",
change_filter = filter.ChangeFilter(branch=repo_branch),
treeStableTimer = 60,
- builderNames = targets))
+ builderNames = list(targets)))
c['schedulers'].append(ForceScheduler(
name = "force",
name = "target",
label = "Build target",
default = "all",
- choices = [ "all" ] + targets
+ choices = set( "all" ) | targets
),
TagChoiceParameter(
name = "tag",
def GetNextBuild(builder, requests):
for r in requests:
- if r.properties and r.properties.hasProperty("tag"):
- return r
+ if r.properties:
+ # order tagged build first
+ if r.properties.hasProperty("tag"):
+ return r
+ # then order by branch order
+ pbranch = r.properties.getProperty("branch")
+ for name in branchNames:
+ if pbranch == name:
+ return r
r = requests[0]
log.msg("GetNextBuild: {:>20} id: {} bsid: {}".format(builder.name, r.id, r.bsid))
env = MakeEnv()
))
- # check arch
+ # check arch - exit early if does not exist - NB: some targets do not define CONFIG_TARGET_target_subtarget
factory.addStep(ShellCommand(
name = "checkarch",
description = "Checking architecture",
- command = ["grep", "-sq", "CONFIG_TARGET_%s=y" %(ts[0]), ".config"],
+ command = 'grep -sq CONFIG_TARGET_%s=y .config && grep -sq CONFIG_TARGET_SUBTARGET=\\"%s\\" .config' %(ts[0], ts[1]),
logEnviron = False,
want_stdout = False,
want_stderr = False,
- haltOnFailure = True
+ haltOnFailure = True,
+ flunkOnFailure = False, # this is not a build FAILURE
))
# find libc suffix
factory.addStep(MasterShellCommand(
name = "signfiles",
description = "Signing files",
- command = ["%s/signall.sh" %(scripts_dir), "%s/signing/%s.%s.tar.gz" %(work_dir, ts[0], ts[1])],
+ command = ["%s/signall.sh" %(scripts_dir), "%s/signing/%s.%s.tar.gz" %(work_dir, ts[0], ts[1]), Interpolate("%(prop:branch)s")],
env = { 'CONFIG_INI': os.getenv("BUILDMASTER_CONFIG", "./config.ini") },
haltOnFailure = True,
doStepIf = IsSignEnabled,