Skip to content

Commit

Permalink
phase2: max_builds is always set to 1
Browse files Browse the repository at this point in the history
Align with phase1 (ac0d815)

Signed-off-by: Thibaut VARÈNE <[email protected]>
  • Loading branch information
f00b4r0 authored and ynezz committed Dec 22, 2023
1 parent bc17dd9 commit 65502c7
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions phase2/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -70,29 +70,19 @@ 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 "):
if ini.has_option(section, "name") and ini.has_option(section, "password") and \
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
Expand Down Expand Up @@ -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"):
Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit 65502c7

Please sign in to comment.