From: Thibaut VARÈNE Date: Fri, 22 Dec 2023 13:32:02 +0000 (+0100) Subject: phase2: max_builds is always set to 1 X-Git-Tag: v12^0 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=65502c7ec51968435036ab43be208fcb08728a5c;p=buildbot.git phase2: max_builds is always set to 1 Align with phase1 (ac0d815) Signed-off-by: Thibaut VARÈNE --- diff --git a/phase2/master.cfg b/phase2/master.cfg index ae994cd..1267cf1 100644 --- a/phase2/master.cfg +++ b/phase2/master.cfg @@ -70,7 +70,6 @@ if ini.has_option("phase2", "persistent"): persistent = ini.getboolean("phase2", "persistent") c['workers'] = [] -max_builds = dict() for section in ini.sections(): if section.startswith("worker "): @@ -78,21 +77,12 @@ for section in ini.sections(): ini.has_option(section, "phase") and ini.getint(section, "phase") == 2: name = ini.get(section, "name") password = ini.get(section, "password") - sl_props = { 'shared_wd': False } - max_builds[name] = 1 - - if ini.has_option(section, "builds"): - max_builds[name] = ini.getint(section, "builds") - - if max_builds[name] == 1: - sl_props['shared_wd'] = True + sl_props = { 'shared_wd': True } if ini.has_option(section, "shared_wd"): sl_props['shared_wd'] = ini.getboolean(section, "shared_wd") - if sl_props['shared_wd'] and (max_builds != 1): - raise ValueError('max_builds must be 1 with shared workdir!') - c['workers'].append(Worker(name, password, max_builds = max_builds[name], properties = sl_props)) + c['workers'].append(Worker(name, password, max_builds = 1, properties = sl_props)) # 'workerPortnum' defines the TCP port to listen on for connections from workers. # This must match the value configured into the buildworkers (with their @@ -277,13 +267,6 @@ def GetDirectorySuffix(props): return "-%02d.%02d" %(int(m.group(1)), int(m.group(2))) return "" -@properties.renderer -def GetNumJobs(props): - if props.hasProperty("workername") and props.hasProperty("nproc"): - return str(int(props["nproc"]) / max_builds[props["workername"]]) - else: - return "1" - @properties.renderer def GetCwd(props): if props.hasProperty("builddir"): @@ -574,7 +557,7 @@ for arch in arches: description = "Building packages", workdir = "build/sdk", timeout = 3600, - command = ["make", Interpolate("-j%(kw:jobs)s", jobs=GetNumJobs), "IGNORE_ERRORS=n m y", "BUILD_LOG=1", "CONFIG_AUTOREMOVE=y", "CONFIG_SIGNED_PACKAGES="], + command = ["make", Interpolate("-j%(prop:nproc:-1)s"), "IGNORE_ERRORS=n m y", "BUILD_LOG=1", "CONFIG_AUTOREMOVE=y", "CONFIG_SIGNED_PACKAGES="], env = {'CCACHE_BASEDIR': Interpolate("%(kw:cwd)s", cwd=GetCwd)}, haltOnFailure = True))