diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-18 11:23:56 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-18 16:32:50 +0000 |
commit | 46a8e0de14ce2cca4c93ec53648d7e01333bbf65 (patch) | |
tree | a0bf88f196cbff5f181d98b801f3c41f98df4338 /distbuild/build_controller.py | |
parent | 51afd2289db20bcf5063ad9512ab1164154ff093 (diff) | |
download | morph-46a8e0de14ce2cca4c93ec53648d7e01333bbf65.tar.gz |
distbuild: Remove the build-steps message
This message was hundreds of kilobytes in size, as it contained a
recursive list of dependencies for each artifact in the build graph. It
was used in the initiator only to print this message:
Build steps in total: 592
This message is now gone. The 'Need to build %d artifacts'
build-progress message now indicates the total build steps instead:
Need to build 300 artifacts, of 592 total
This is a compatible change to the distbuild protocol: old initiators
will continue to work as normal with new controllers that don't send
the build-steps message.
Diffstat (limited to 'distbuild/build_controller.py')
-rw-r--r-- | distbuild/build_controller.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/distbuild/build_controller.py b/distbuild/build_controller.py index 32da92f4..fd4b2105 100644 --- a/distbuild/build_controller.py +++ b/distbuild/build_controller.py @@ -71,13 +71,6 @@ class BuildProgress(object): self.message_text = message_text -class BuildSteps(object): - - def __init__(self, request_id, artifact): - self.id = request_id - self.artifact = artifact - - class BuildStepStarted(object): def __init__(self, request_id, step_name, worker_name): @@ -295,9 +288,6 @@ class BuildController(distbuild.StateMachine): progress = BuildProgress( self._request['id'], 'Finished computing build graph') self.mainloop.queue_event(BuildController, progress) - - build_steps = BuildSteps(self._request['id'], artifact) - self.mainloop.queue_event(BuildController, build_steps) self.mainloop.queue_event(self, _GotGraph(artifact)) @@ -348,7 +338,6 @@ class BuildController(distbuild.StateMachine): '(helper id: %s)' % self._helper_id) def _maybe_handle_cache_response(self, event_source, event): - def set_status(artifact): is_in_cache = cache_state[artifact.basename()] artifact.state = BUILT if is_in_cache else UNBUILT @@ -370,15 +359,14 @@ class BuildController(distbuild.StateMachine): map_build_graph(self._artifact, set_status) self.mainloop.queue_event(self, _Annotated()) - count = sum(map_build_graph(self._artifact, - lambda a: 1 if a.state == UNBUILT else 0)) - + unbuilt = len([a for a in self._artifact.walk() if a.state == UNBUILT]) + total = len([a for _ in self._artifact.walk()]) progress = BuildProgress( self._request['id'], - 'Need to build %d artifacts' % count) + 'Need to build %d artifacts, of %d total' % (unbuilt, total)) self.mainloop.queue_event(BuildController, progress) - if count == 0: + if total == 0: logging.info('There seems to be nothing to build') self.mainloop.queue_event(self, _Built()) |