Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phase2: max_builds is always set to 1 #25

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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