From 3bbbc02a7f8b677026fbc856a336225e2630c050 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20=C5=A0tetiar?= Date: Sun, 18 Jun 2023 07:26:17 +0200 Subject: [PATCH] phase1: do not leak targets between branches MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Robert noticed, that after rename of `ipq807x` target in main branch to `qualcommax/ipq807x` subtarget, that buildbot is trying to build this new `qualcommax/ipq807x` subtarget on `openwrt-23.05` branch as well. Thibaut later explained, that this is by design, his initial idea was to find exhaustive list of all targets and let the `checkarch` step do the final triaging. I find this approach confusing, because if the subtarget is not present in that branch, we shouldn't have builder for it configured as well. Furthermore wasting roughly 5 minutes of precious buildworker time to checkout all feeds and then just find out, that we're not going to use those seems suboptimal as well. So lets fix it by using builders for targets as present in respective branches. Fixes: #14 Reported-by: Robert Marko Signed-off-by: Petr Å tetiar --- phase1/master.cfg | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/phase1/master.cfg b/phase1/master.cfg index 799a40b..c4bccea 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -288,7 +288,7 @@ c["prioritizeBuilders"] = prioritizeBuilders ####### CHANGESOURCES # find targets -targets = set() +targets = dict() def populateTargets(): @@ -323,12 +323,13 @@ def populateTargets(): cwd=sourcegit, ) + targets[branch] = set() while True: line = findtargets.stdout.readline() if not line: break ta = line.decode().strip().split(" ") - targets.add(ta[0]) + targets[branch].add(ta[0]) subprocess.call(["rm", "-rf", sourcegit]) @@ -521,7 +522,7 @@ c["schedulers"].append( name="target", label="Build target", default="all", - choices=["all"] + list(targets), + choices=["all"] + [t for b in branchNames for t in targets[b]], ), TagChoiceParameter(name="tag", label="Build tag", default=""), ], @@ -735,7 +736,7 @@ c["builders"].append( # NB the phase1 build factory assumes workers are single-build only -for target in targets: +def prepareFactory(target): ts = target.split("/") factory = BuildFactory() @@ -1743,13 +1744,17 @@ for target in targets: ) ) - for brname in branchNames: + return factory + + +for brname in branchNames: + for target in targets[brname]: bldrname = brname + "_" + target c["builders"].append( BuilderConfig( name=bldrname, workernames=workerNames, - factory=factory, + factory=prepareFactory(target), tags=[ brname, ], -- 2.30.2