mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
cooker: show progress bar before initializing the cache
This ensures that the time spent loading the cache from disk occurs with the progress bar up. Though the progress bar stays at 0% during this period, I think this is an improvement over the multi-second stall which occurred previously before the progress bar came up. Ideally, we'd integrate cache loading from disk into the progress display, but this is a first step. (Bitbake rev: f6d0a5c219f9deb84f702450d30d868ba6271f77) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
committed by
Richard Purdie
parent
6cd15a1ea0
commit
60226ff35c
+16
-13
@@ -636,8 +636,6 @@ class BBCooker:
|
|||||||
if (task == None):
|
if (task == None):
|
||||||
task = self.configuration.cmd
|
task = self.configuration.cmd
|
||||||
|
|
||||||
self.status = bb.cache.CacheData()
|
|
||||||
|
|
||||||
(fn, cls) = bb.cache.Cache.virtualfn2realfn(buildfile)
|
(fn, cls) = bb.cache.Cache.virtualfn2realfn(buildfile)
|
||||||
buildfile = self.matchFile(fn)
|
buildfile = self.matchFile(fn)
|
||||||
fn = bb.cache.Cache.realfn2virtual(buildfile, cls)
|
fn = bb.cache.Cache.realfn2virtual(buildfile, cls)
|
||||||
@@ -982,7 +980,6 @@ class CookerParser(object):
|
|||||||
self.filelist = filelist
|
self.filelist = filelist
|
||||||
self.cooker = cooker
|
self.cooker = cooker
|
||||||
self.cfgdata = cooker.configuration.data
|
self.cfgdata = cooker.configuration.data
|
||||||
self.bb_cache = bb.cache.Cache(self.cfgdata)
|
|
||||||
|
|
||||||
# Accounting statistics
|
# Accounting statistics
|
||||||
self.parsed = 0
|
self.parsed = 0
|
||||||
@@ -995,12 +992,13 @@ class CookerParser(object):
|
|||||||
self.total = len(filelist)
|
self.total = len(filelist)
|
||||||
|
|
||||||
self.current = 0
|
self.current = 0
|
||||||
|
self.started = False
|
||||||
|
self.bb_cache = None
|
||||||
|
self.task_queue = None
|
||||||
self.result_queue = None
|
self.result_queue = None
|
||||||
self.fromcache = None
|
self.fromcache = None
|
||||||
self.progress_chunk = self.total / 100
|
self.progress_chunk = self.total / 100
|
||||||
|
|
||||||
self.launch_processes()
|
|
||||||
|
|
||||||
def launch_processes(self):
|
def launch_processes(self):
|
||||||
self.task_queue = multiprocessing.Queue()
|
self.task_queue = multiprocessing.Queue()
|
||||||
self.result_queue = multiprocessing.Queue()
|
self.result_queue = multiprocessing.Queue()
|
||||||
@@ -1045,13 +1043,6 @@ class CookerParser(object):
|
|||||||
if self.error > 0:
|
if self.error > 0:
|
||||||
raise ParsingErrorsFound()
|
raise ParsingErrorsFound()
|
||||||
|
|
||||||
def reparse(self, filename):
|
|
||||||
infos = self.bb_cache.parse(filename,
|
|
||||||
self.cooker.get_file_appends(filename),
|
|
||||||
self.cfgdata)
|
|
||||||
for vfn, info in infos:
|
|
||||||
self.cooker.status.add_from_recipeinfo(vfn, info)
|
|
||||||
|
|
||||||
def parse_next(self):
|
def parse_next(self):
|
||||||
if self.current >= self.total:
|
if self.current >= self.total:
|
||||||
event = bb.event.ParseCompleted(self.cached, self.parsed,
|
event = bb.event.ParseCompleted(self.cached, self.parsed,
|
||||||
@@ -1061,9 +1052,15 @@ class CookerParser(object):
|
|||||||
bb.event.fire(event, self.cfgdata)
|
bb.event.fire(event, self.cfgdata)
|
||||||
self.shutdown()
|
self.shutdown()
|
||||||
return False
|
return False
|
||||||
elif self.current == 0:
|
elif not self.started:
|
||||||
|
self.started = True
|
||||||
bb.event.fire(bb.event.ParseStarted(self.total, self.skipped, self.masked),
|
bb.event.fire(bb.event.ParseStarted(self.total, self.skipped, self.masked),
|
||||||
self.cfgdata)
|
self.cfgdata)
|
||||||
|
return True
|
||||||
|
elif not self.bb_cache:
|
||||||
|
self.bb_cache = bb.cache.Cache(self.cfgdata)
|
||||||
|
self.launch_processes()
|
||||||
|
return True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.result_queue.empty() and self.fromcache:
|
if self.result_queue.empty() and self.fromcache:
|
||||||
@@ -1099,3 +1096,9 @@ class CookerParser(object):
|
|||||||
self.current += 1
|
self.current += 1
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def reparse(self, filename):
|
||||||
|
infos = self.bb_cache.parse(filename,
|
||||||
|
self.cooker.get_file_appends(filename),
|
||||||
|
self.cfgdata)
|
||||||
|
for vfn, info in infos:
|
||||||
|
self.cooker.status.add_from_recipeinfo(vfn, info)
|
||||||
|
|||||||
Reference in New Issue
Block a user