Skip to content

Commit

Permalink
Merge pull request #316 from kallisti5/master
Browse files Browse the repository at this point in the history
buildmaster/console: drop ncurses console
  • Loading branch information
kallisti5 authored Jan 10, 2025
2 parents 348aa93 + 14f3482 commit 982945b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 223 deletions.
23 changes: 1 addition & 22 deletions HaikuPorter/BuildMaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ def __init__(self, portsTreePath, packageRepository, options):
self.endTime = None
self.impulseData = [None] * 500
self.impulseIndex = -1
self.display = None

self.buildableCondition = threading.Condition()
# protectes the scheduled builds lists
Expand Down Expand Up @@ -322,23 +321,17 @@ def schedule(self, port, missingPackageIDs, presentDependencyPackages):

self._setBuildStatus('scheduling')

def runBuilds(self, stdscr=None):
def runBuilds(self):
# Move anything to the lost state that depends on skipped builds.
for skippedBuild in self.skippedBuilds:
if skippedBuild.port:
self._packagesCompleted(skippedBuild.port.packages, False)

try:
if stdscr:
from .Display import Display
self.display = Display(stdscr, len(self.activeBuilders))

self._ensureConsistentSchedule()
self.totalBuildCount = len(self.scheduledBuilds) + len(self.blockedBuilds)
self.startTime = time.time()
self._setBuildStatus('starting builds')
if self.display:
self.display.updateSummary(self.summary)
while True:
self._runBuilds()
self._waitForBuildsToComplete()
Expand Down Expand Up @@ -382,9 +375,6 @@ def _runBuilds(self):
if self.buildStatus != 'waiting for packages':
self.logger.info('nothing buildable, waiting for packages')
self._setBuildStatus('waiting for packages')
if self.display:
self.display.updateSummary(self.summary)
self.display.updateBuilders(self.status)
self.buildableCondition.wait(1)
continue
else:
Expand All @@ -397,11 +387,6 @@ def _waitForBuildsToComplete(self):
with self.builderCondition:
if len(self.availableBuilders) == len(self.activeBuilders):
break

if self.display:
self.display.updateSummary(self.summary)
self.display.updateBuilders(self.status)

self._setBuildStatus('waiting for all builds to complete')
self.builderCondition.wait(1)

Expand All @@ -422,9 +407,6 @@ def _runBuild(self, scheduledBuild):

if len(self.availableBuilders) == 0:
self._setBuildStatus('waiting for available builders')
if self.display:
self.display.updateSummary(self.summary)
self.display.updateBuilders(self.status)
self.builderCondition.wait(1)
continue

Expand Down Expand Up @@ -515,9 +497,6 @@ def _buildThread(self, builder, scheduledBuild, buildNumber):
outputFile.write(json.dumps(record.status))

self.buildHistory.append(record)
if self.display:
self.display.updateHistory(self.buildHistory)

self._buildComplete(scheduledBuild, buildSuccess,
self.completeBuilds if buildSuccess else self.failedBuilds)

Expand Down
192 changes: 0 additions & 192 deletions HaikuPorter/Display.py

This file was deleted.

7 changes: 1 addition & 6 deletions HaikuPorter/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,7 @@ def run(self, args):
print('\t' + violation)

if self.options.buildMaster:
if self.options.display:
from .Display import DisplayContext
with DisplayContext() as ctxt:
self.buildMaster.runBuilds(ctxt.stdscr)
else:
self.buildMaster.runBuilds()
self.buildMaster.runBuilds()

def _listDependencies(self, port):
print('-' * 70)
Expand Down
3 changes: 0 additions & 3 deletions HaikuPorter/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ def parseOptions():
help='specifies an optional remote reporting server (ex: mongodb://)')
buildmaster_flags.add_option('--local-builders', action='store', type='int',
dest='localBuilders', default=0, help='number of local builders (native Haiku only)')
buildmaster_flags.add_option('--console', action='store_true', dest='display',
default=False,
help='display a build master curses console')

parser.add_option_group(basic_actions)
parser.add_option_group(basic_flags)
Expand Down

0 comments on commit 982945b

Please sign in to comment.