diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/cache.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/cooker.py | 53 | ||||
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/shell.py | 6 |
4 files changed, 33 insertions, 32 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 5adce594f0..2b92ed01f0 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -172,7 +172,7 @@ class Cache(object): | |||
172 | # If any of configuration.data's dependencies are newer than the | 172 | # If any of configuration.data's dependencies are newer than the |
173 | # cache there isn't even any point in loading it... | 173 | # cache there isn't even any point in loading it... |
174 | newest_mtime = 0 | 174 | newest_mtime = 0 |
175 | deps = bb.data.getVar("__depends", data) | 175 | deps = bb.data.getVar("__base_depends", data) |
176 | 176 | ||
177 | old_mtimes = [old_mtime for _, old_mtime in deps] | 177 | old_mtimes = [old_mtime for _, old_mtime in deps] |
178 | old_mtimes.append(newest_mtime) | 178 | old_mtimes.append(newest_mtime) |
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 53f88b253c..b573c32ed9 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -75,9 +75,7 @@ class BBCooker: | |||
75 | 75 | ||
76 | def __init__(self, configuration, server): | 76 | def __init__(self, configuration, server): |
77 | self.status = None | 77 | self.status = None |
78 | 78 | self.appendlist = {} | |
79 | self.cache = None | ||
80 | self.bb_cache = None | ||
81 | 79 | ||
82 | if server: | 80 | if server: |
83 | self.server = server.BitBakeServer(self) | 81 | self.server = server.BitBakeServer(self) |
@@ -217,8 +215,6 @@ class BBCooker: | |||
217 | envdata = None | 215 | envdata = None |
218 | 216 | ||
219 | if buildfile: | 217 | if buildfile: |
220 | self.cb = None | ||
221 | self.bb_cache = bb.cache.init(self) | ||
222 | fn = self.matchFile(buildfile) | 218 | fn = self.matchFile(buildfile) |
223 | elif len(pkgs_to_build) == 1: | 219 | elif len(pkgs_to_build) == 1: |
224 | self.updateCache() | 220 | self.updateCache() |
@@ -239,7 +235,7 @@ class BBCooker: | |||
239 | 235 | ||
240 | if fn: | 236 | if fn: |
241 | try: | 237 | try: |
242 | envdata = self.bb_cache.loadDataFull(fn, self.get_file_appends(fn), self.configuration.data) | 238 | envdata = bb.cache.Cache.loadDataFull(fn, self.get_file_appends(fn), self.configuration.data) |
243 | except Exception, e: | 239 | except Exception, e: |
244 | parselog.exception("Unable to read %s", fn) | 240 | parselog.exception("Unable to read %s", fn) |
245 | raise | 241 | raise |
@@ -601,7 +597,7 @@ class BBCooker: | |||
601 | """ | 597 | """ |
602 | 598 | ||
603 | bf = os.path.abspath(buildfile) | 599 | bf = os.path.abspath(buildfile) |
604 | (filelist, masked) = self.collect_bbfiles() | 600 | filelist, masked = self.collect_bbfiles() |
605 | try: | 601 | try: |
606 | os.stat(bf) | 602 | os.stat(bf) |
607 | return [bf] | 603 | return [bf] |
@@ -640,21 +636,25 @@ class BBCooker: | |||
640 | if (task == None): | 636 | if (task == None): |
641 | task = self.configuration.cmd | 637 | task = self.configuration.cmd |
642 | 638 | ||
643 | self.bb_cache = bb.cache.init(self) | ||
644 | self.status = bb.cache.CacheData() | 639 | self.status = bb.cache.CacheData() |
645 | 640 | ||
646 | (fn, cls) = self.bb_cache.virtualfn2realfn(buildfile) | 641 | (fn, cls) = bb.cache.Cache.virtualfn2realfn(buildfile) |
647 | buildfile = self.matchFile(fn) | 642 | buildfile = self.matchFile(fn) |
648 | fn = self.bb_cache.realfn2virtual(buildfile, cls) | 643 | fn = bb.cache.Cache.realfn2virtual(buildfile, cls) |
649 | 644 | ||
650 | self.buildSetVars() | 645 | self.buildSetVars() |
651 | 646 | ||
652 | # Load data into the cache for fn and parse the loaded cache data | 647 | self.status = bb.cache.CacheData() |
653 | the_data = self.bb_cache.loadDataFull(fn, self.get_file_appends(fn), self.configuration.data) | 648 | infos = bb.cache.Cache.parse(fn, self.get_file_appends(fn), \ |
654 | self.bb_cache.add(fn, the_data, self.status) | 649 | self.configuration.data) |
650 | maininfo = None | ||
651 | for vfn, info in infos: | ||
652 | self.status.add_from_recipeinfo(vfn, info) | ||
653 | if vfn == fn: | ||
654 | maininfo = info | ||
655 | 655 | ||
656 | # Tweak some variables | 656 | # Tweak some variables |
657 | item = self.bb_cache.getVar('PN', fn, True) | 657 | item = maininfo.pn |
658 | self.status.ignored_dependencies = set() | 658 | self.status.ignored_dependencies = set() |
659 | self.status.bbfile_priority[fn] = 1 | 659 | self.status.bbfile_priority[fn] = 1 |
660 | 660 | ||
@@ -852,7 +852,6 @@ class BBCooker: | |||
852 | def collect_bbfiles( self ): | 852 | def collect_bbfiles( self ): |
853 | """Collect all available .bb build files""" | 853 | """Collect all available .bb build files""" |
854 | parsed, cached, skipped, masked = 0, 0, 0, 0 | 854 | parsed, cached, skipped, masked = 0, 0, 0, 0 |
855 | self.bb_cache = bb.cache.init(self) | ||
856 | 855 | ||
857 | collectlog.debug(1, "collecting .bb files") | 856 | collectlog.debug(1, "collecting .bb files") |
858 | 857 | ||
@@ -901,7 +900,6 @@ class BBCooker: | |||
901 | collectlog.debug(1, "skipping %s: unknown file extension", f) | 900 | collectlog.debug(1, "skipping %s: unknown file extension", f) |
902 | 901 | ||
903 | # Build a list of .bbappend files for each .bb file | 902 | # Build a list of .bbappend files for each .bb file |
904 | self.appendlist = {} | ||
905 | for f in bbappend: | 903 | for f in bbappend: |
906 | base = os.path.basename(f).replace('.bbappend', '.bb') | 904 | base = os.path.basename(f).replace('.bbappend', '.bb') |
907 | if not base in self.appendlist: | 905 | if not base in self.appendlist: |
@@ -913,7 +911,7 @@ class BBCooker: | |||
913 | def get_file_appends(self, fn): | 911 | def get_file_appends(self, fn): |
914 | """ | 912 | """ |
915 | Returns a list of .bbappend files to apply to fn | 913 | Returns a list of .bbappend files to apply to fn |
916 | NB: collect_files() must have been called prior to this | 914 | NB: collect_bbfiles() must have been called prior to this |
917 | """ | 915 | """ |
918 | f = os.path.basename(fn) | 916 | f = os.path.basename(fn) |
919 | if f in self.appendlist: | 917 | if f in self.appendlist: |
@@ -981,10 +979,10 @@ class CookerExit(bb.event.Event): | |||
981 | 979 | ||
982 | class CookerParser(object): | 980 | class CookerParser(object): |
983 | def __init__(self, cooker, filelist, masked): | 981 | def __init__(self, cooker, filelist, masked): |
984 | # Internal data | ||
985 | self.filelist = filelist | 982 | self.filelist = filelist |
986 | self.cooker = cooker | 983 | self.cooker = cooker |
987 | self.cfgdata = cooker.configuration.data | 984 | self.cfgdata = cooker.configuration.data |
985 | self.bb_cache = bb.cache.Cache(self.cfgdata) | ||
988 | 986 | ||
989 | # Accounting statistics | 987 | # Accounting statistics |
990 | self.parsed = 0 | 988 | self.parsed = 0 |
@@ -996,7 +994,6 @@ class CookerParser(object): | |||
996 | self.virtuals = 0 | 994 | self.virtuals = 0 |
997 | self.total = len(filelist) | 995 | self.total = len(filelist) |
998 | 996 | ||
999 | # current to the next file to parse | ||
1000 | self.current = 0 | 997 | self.current = 0 |
1001 | self.result_queue = None | 998 | self.result_queue = None |
1002 | self.fromcache = None | 999 | self.fromcache = None |
@@ -1010,7 +1007,7 @@ class CookerParser(object): | |||
1010 | self.fromcache = [] | 1007 | self.fromcache = [] |
1011 | for filename in self.filelist: | 1008 | for filename in self.filelist: |
1012 | appends = self.cooker.get_file_appends(filename) | 1009 | appends = self.cooker.get_file_appends(filename) |
1013 | if not self.cooker.bb_cache.cacheValid(filename): | 1010 | if not self.bb_cache.cacheValid(filename): |
1014 | self.task_queue.put((filename, appends)) | 1011 | self.task_queue.put((filename, appends)) |
1015 | else: | 1012 | else: |
1016 | self.fromcache.append((filename, appends)) | 1013 | self.fromcache.append((filename, appends)) |
@@ -1042,13 +1039,19 @@ class CookerParser(object): | |||
1042 | self.task_queue.close() | 1039 | self.task_queue.close() |
1043 | for process in self.processes: | 1040 | for process in self.processes: |
1044 | process.join() | 1041 | process.join() |
1045 | threading.Thread(target=self.cooker.bb_cache.sync).start() | 1042 | threading.Thread(target=self.bb_cache.sync).start() |
1046 | threading.Thread(target=bb.codeparser.parser_cache_save(self.cooker.configuration.data)).start() | 1043 | threading.Thread(target=bb.codeparser.parser_cache_save(self.cooker.configuration.data)).start() |
1047 | if self.error > 0: | 1044 | if self.error > 0: |
1048 | raise ParsingErrorsFound() | 1045 | raise ParsingErrorsFound() |
1049 | 1046 | ||
1047 | def reparse(self, filename): | ||
1048 | infos = self.bb_cache.parse(filename, | ||
1049 | self.cooker.get_file_appends(filename), | ||
1050 | self.cfgdata) | ||
1051 | for vfn, info in infos: | ||
1052 | self.cooker.status.add_from_recipeinfo(vfn, info) | ||
1053 | |||
1050 | def parse_next(self): | 1054 | def parse_next(self): |
1051 | cooker = self.cooker | ||
1052 | if self.current >= self.total: | 1055 | if self.current >= self.total: |
1053 | event = bb.event.ParseCompleted(self.cached, self.parsed, | 1056 | event = bb.event.ParseCompleted(self.cached, self.parsed, |
1054 | self.skipped, self.masked, | 1057 | self.skipped, self.masked, |
@@ -1064,7 +1067,7 @@ class CookerParser(object): | |||
1064 | try: | 1067 | try: |
1065 | if self.result_queue.empty() and self.fromcache: | 1068 | if self.result_queue.empty() and self.fromcache: |
1066 | filename, appends = self.fromcache.pop() | 1069 | filename, appends = self.fromcache.pop() |
1067 | _, infos = cooker.bb_cache.load(filename, appends, self.cfgdata) | 1070 | _, infos = self.bb_cache.load(filename, appends, self.cfgdata) |
1068 | parsed = False | 1071 | parsed = False |
1069 | else: | 1072 | else: |
1070 | infos = self.result_queue.get() | 1073 | infos = self.result_queue.get() |
@@ -1083,8 +1086,8 @@ class CookerParser(object): | |||
1083 | self.virtuals += len(infos) | 1086 | self.virtuals += len(infos) |
1084 | 1087 | ||
1085 | for virtualfn, info in infos: | 1088 | for virtualfn, info in infos: |
1086 | cooker.bb_cache.add_info(virtualfn, info, cooker.status, | 1089 | self.bb_cache.add_info(virtualfn, info, self.cooker.status, |
1087 | parsed=parsed) | 1090 | parsed=parsed) |
1088 | if info.skipped: | 1091 | if info.skipped: |
1089 | self.skipped += 1 | 1092 | self.skipped += 1 |
1090 | finally: | 1093 | finally: |
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index a80feb9504..6282e5cf9b 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1015,7 +1015,7 @@ class RunQueue: | |||
1015 | for task in range(len(self.rqdata.runq_fnid)): | 1015 | for task in range(len(self.rqdata.runq_fnid)): |
1016 | if self.rqdata.runq_fnid[task] not in done: | 1016 | if self.rqdata.runq_fnid[task] not in done: |
1017 | fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]] | 1017 | fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]] |
1018 | the_data = self.cooker.bb_cache.loadDataFull(fn, self.cooker.get_file_appends(fn), self.cooker.configuration.data) | 1018 | the_data = bb.cache.Cache.loadDataFull(fn, self.cooker.get_file_appends(fn), self.cooker.configuration.data) |
1019 | done.add(self.rqdata.runq_fnid[task]) | 1019 | done.add(self.rqdata.runq_fnid[task]) |
1020 | 1020 | ||
1021 | bb.parse.siggen.dump_sigs(self.rqdata.dataCache) | 1021 | bb.parse.siggen.dump_sigs(self.rqdata.dataCache) |
@@ -1088,7 +1088,7 @@ class RunQueueExecute: | |||
1088 | return | 1088 | return |
1089 | 1089 | ||
1090 | def fork_off_task(self, fn, task, taskname): | 1090 | def fork_off_task(self, fn, task, taskname): |
1091 | the_data = self.cooker.bb_cache.loadDataFull(fn, self.cooker.get_file_appends(fn), self.cooker.configuration.data) | 1091 | the_data = bb.cache.Cache.loadDataFull(fn, self.cooker.get_file_appends(fn), self.cooker.configuration.data) |
1092 | 1092 | ||
1093 | env = bb.data.export_vars(the_data) | 1093 | env = bb.data.export_vars(the_data) |
1094 | env = bb.data.export_envvars(env, the_data) | 1094 | env = bb.data.export_envvars(env, the_data) |
diff --git a/bitbake/lib/bb/shell.py b/bitbake/lib/bb/shell.py index c61e93a1cb..3319e2d1cc 100644 --- a/bitbake/lib/bb/shell.py +++ b/bitbake/lib/bb/shell.py | |||
@@ -272,9 +272,7 @@ class BitBakeShellCommands: | |||
272 | bbfile = params[0] | 272 | bbfile = params[0] |
273 | print("SHELL: Parsing '%s'" % bbfile) | 273 | print("SHELL: Parsing '%s'" % bbfile) |
274 | parse.update_mtime( bbfile ) | 274 | parse.update_mtime( bbfile ) |
275 | cooker.bb_cache.cacheValidUpdate(bbfile) | 275 | cooker.parser.reparse(bbfile) |
276 | fromCache = cooker.bb_cache.loadData(bbfile, cooker.configuration.data, cooker.status) | ||
277 | cooker.bb_cache.sync() | ||
278 | if False: #fromCache: | 276 | if False: #fromCache: |
279 | print("SHELL: File has not been updated, not reparsing") | 277 | print("SHELL: File has not been updated, not reparsing") |
280 | else: | 278 | else: |
@@ -443,7 +441,7 @@ SRC_URI = "" | |||
443 | name, var = params | 441 | name, var = params |
444 | bbfile = self._findProvider( name ) | 442 | bbfile = self._findProvider( name ) |
445 | if bbfile is not None: | 443 | if bbfile is not None: |
446 | the_data = cooker.bb_cache.loadDataFull(bbfile, cooker.configuration.data) | 444 | the_data = cache.Cache.loadDataFull(bbfile, cooker.configuration.data) |
447 | value = the_data.getVar( var, 1 ) | 445 | value = the_data.getVar( var, 1 ) |
448 | print(value) | 446 | print(value) |
449 | else: | 447 | else: |