summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/knotty.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-11-18 22:47:36 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:43 +0000
commit7c9444e9a58438058ec577bd8c2e51820c98072d (patch)
tree55074d2c00afa924707bb5b5d30b22bc6688594d /bitbake/lib/bb/ui/knotty.py
parent95d2f56126d459b9e7f000d22ed7c1206d1a8f68 (diff)
downloadpoky-7c9444e9a58438058ec577bd8c2e51820c98072d.tar.gz
cache: sync the cache file to disk in the background
This version uses a thread rather than a process, to avoid problems with waitpid handling. This gives slightly less overall build time reduction than the separate process for it did (this reduces a -c compile coreutils-native by about 3 seconds, while the process reduced it by 7 seconds), however this time is quite insignificant relative to a typical build. The biggest issue with non-backgrounded syncing is the perceived delay before work begins, and this resolves that without breaking anything, or so it seems. (Bitbake rev: 5ab6c5c7b007b8c77c751582141afc07c183d672) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/ui/knotty.py')
-rw-r--r--bitbake/lib/bb/ui/knotty.py34
1 files changed, 19 insertions, 15 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index a34991bb68..326f164353 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -78,6 +78,7 @@ def init(server, eventHandler):
78 return 1 78 return 1
79 79
80 pbar = None 80 pbar = None
81 interactive = os.isatty(sys.stdout.fileno())
81 shutdown = 0 82 shutdown = 0
82 return_value = 0 83 return_value = 0
83 while True: 84 while True:
@@ -132,23 +133,26 @@ def init(server, eventHandler):
132 if isinstance(event, bb.build.TaskBase): 133 if isinstance(event, bb.build.TaskBase):
133 logger.info(event._message) 134 logger.info(event._message)
134 continue 135 continue
136 if isinstance(event, bb.event.ParseStarted):
137 if interactive:
138 pbar = progressbar.ProgressBar(widgets=widgets,
139 maxval=event.total).start()
140 else:
141 sys.stdout.write("Parsing recipes...")
142 sys.stdout.flush()
143 continue
135 if isinstance(event, bb.event.ParseProgress): 144 if isinstance(event, bb.event.ParseProgress):
136 current, total = event.sofar, event.total 145 if interactive:
137 if os.isatty(sys.stdout.fileno()): 146 pbar.update(event.current)
138 if not pbar: 147 continue
139 pbar = progressbar.ProgressBar(widgets=widgets, 148 if isinstance(event, bb.event.ParseCompleted):
140 maxval=total).start() 149 if interactive:
141 pbar.update(current) 150 pbar.update(event.total)
142 else: 151 else:
143 if current == 1: 152 sys.stdout.write("done.\n")
144 sys.stdout.write("Parsing .bb files, please wait...") 153 sys.stdout.flush()
145 sys.stdout.flush() 154 print(("\nParsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
146 if current == total: 155 % ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors)))
147 sys.stdout.write("done.")
148 sys.stdout.flush()
149 if current == total:
150 print(("\nParsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
151 % ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors)))
152 continue 156 continue
153 157
154 if isinstance(event, bb.command.CookerCommandCompleted): 158 if isinstance(event, bb.command.CookerCommandCompleted):