diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-11-21 11:59:05 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:44 +0000 |
commit | 60226ff35c08c6590fe197e4c5d41d43dc4c3d3b (patch) | |
tree | e6270674270a6f487d9f0c091d81d3dd0884e158 | |
parent | 6cd15a1ea08792618a0bcb04aa33bbd6d53d48f8 (diff) | |
download | poky-60226ff35c08c6590fe197e4c5d41d43dc4c3d3b.tar.gz |
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>
-rw-r--r-- | bitbake/lib/bb/cooker.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 8a3caeb4cc..e40ec3dceb 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -636,8 +636,6 @@ class BBCooker: | |||
636 | if (task == None): | 636 | if (task == None): |
637 | task = self.configuration.cmd | 637 | task = self.configuration.cmd |
638 | 638 | ||
639 | self.status = bb.cache.CacheData() | ||
640 | |||
641 | (fn, cls) = bb.cache.Cache.virtualfn2realfn(buildfile) | 639 | (fn, cls) = bb.cache.Cache.virtualfn2realfn(buildfile) |
642 | buildfile = self.matchFile(fn) | 640 | buildfile = self.matchFile(fn) |
643 | fn = bb.cache.Cache.realfn2virtual(buildfile, cls) | 641 | fn = bb.cache.Cache.realfn2virtual(buildfile, cls) |
@@ -982,7 +980,6 @@ class CookerParser(object): | |||
982 | self.filelist = filelist | 980 | self.filelist = filelist |
983 | self.cooker = cooker | 981 | self.cooker = cooker |
984 | self.cfgdata = cooker.configuration.data | 982 | self.cfgdata = cooker.configuration.data |
985 | self.bb_cache = bb.cache.Cache(self.cfgdata) | ||
986 | 983 | ||
987 | # Accounting statistics | 984 | # Accounting statistics |
988 | self.parsed = 0 | 985 | self.parsed = 0 |
@@ -995,12 +992,13 @@ class CookerParser(object): | |||
995 | self.total = len(filelist) | 992 | self.total = len(filelist) |
996 | 993 | ||
997 | self.current = 0 | 994 | self.current = 0 |
995 | self.started = False | ||
996 | self.bb_cache = None | ||
997 | self.task_queue = None | ||
998 | self.result_queue = None | 998 | self.result_queue = None |
999 | self.fromcache = None | 999 | self.fromcache = None |
1000 | self.progress_chunk = self.total / 100 | 1000 | self.progress_chunk = self.total / 100 |
1001 | 1001 | ||
1002 | self.launch_processes() | ||
1003 | |||
1004 | def launch_processes(self): | 1002 | def launch_processes(self): |
1005 | self.task_queue = multiprocessing.Queue() | 1003 | self.task_queue = multiprocessing.Queue() |
1006 | self.result_queue = multiprocessing.Queue() | 1004 | self.result_queue = multiprocessing.Queue() |
@@ -1045,13 +1043,6 @@ class CookerParser(object): | |||
1045 | if self.error > 0: | 1043 | if self.error > 0: |
1046 | raise ParsingErrorsFound() | 1044 | raise ParsingErrorsFound() |
1047 | 1045 | ||
1048 | def reparse(self, filename): | ||
1049 | infos = self.bb_cache.parse(filename, | ||
1050 | self.cooker.get_file_appends(filename), | ||
1051 | self.cfgdata) | ||
1052 | for vfn, info in infos: | ||
1053 | self.cooker.status.add_from_recipeinfo(vfn, info) | ||
1054 | |||
1055 | def parse_next(self): | 1046 | def parse_next(self): |
1056 | if self.current >= self.total: | 1047 | if self.current >= self.total: |
1057 | event = bb.event.ParseCompleted(self.cached, self.parsed, | 1048 | event = bb.event.ParseCompleted(self.cached, self.parsed, |
@@ -1061,9 +1052,15 @@ class CookerParser(object): | |||
1061 | bb.event.fire(event, self.cfgdata) | 1052 | bb.event.fire(event, self.cfgdata) |
1062 | self.shutdown() | 1053 | self.shutdown() |
1063 | return False | 1054 | return False |
1064 | elif self.current == 0: | 1055 | elif not self.started: |
1056 | self.started = True | ||
1065 | bb.event.fire(bb.event.ParseStarted(self.total, self.skipped, self.masked), | 1057 | bb.event.fire(bb.event.ParseStarted(self.total, self.skipped, self.masked), |
1066 | self.cfgdata) | 1058 | self.cfgdata) |
1059 | return True | ||
1060 | elif not self.bb_cache: | ||
1061 | self.bb_cache = bb.cache.Cache(self.cfgdata) | ||
1062 | self.launch_processes() | ||
1063 | return True | ||
1067 | 1064 | ||
1068 | try: | 1065 | try: |
1069 | if self.result_queue.empty() and self.fromcache: | 1066 | if self.result_queue.empty() and self.fromcache: |
@@ -1099,3 +1096,9 @@ class CookerParser(object): | |||
1099 | self.current += 1 | 1096 | self.current += 1 |
1100 | return True | 1097 | return True |
1101 | 1098 | ||
1099 | def reparse(self, filename): | ||
1100 | infos = self.bb_cache.parse(filename, | ||
1101 | self.cooker.get_file_appends(filename), | ||
1102 | self.cfgdata) | ||
1103 | for vfn, info in infos: | ||
1104 | self.cooker.status.add_from_recipeinfo(vfn, info) | ||