summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-05-13 07:53:18 +0000
committerRichard Purdie <richard@openedhand.com>2008-05-13 07:53:18 +0000
commite14d7dcbeea45e2000b9ec3174d24aa90f786adc (patch)
tree5d361178fb09e20fd5e2f818efefeda6f44fe931 /bitbake
parent152f14b598655535664e51ac83318d2c60dfa7d4 (diff)
downloadpoky-e14d7dcbeea45e2000b9ec3174d24aa90f786adc.tar.gz
bitbake: Sync with 1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4463 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/ChangeLog8
-rw-r--r--bitbake/lib/bb/persist_data.py4
-rw-r--r--bitbake/lib/bb/providers.py28
-rw-r--r--bitbake/lib/bb/runqueue.py37
-rw-r--r--bitbake/lib/bb/taskdata.py10
5 files changed, 52 insertions, 35 deletions
diff --git a/bitbake/ChangeLog b/bitbake/ChangeLog
index d00a52d2b6..62be6ea126 100644
--- a/bitbake/ChangeLog
+++ b/bitbake/ChangeLog
@@ -33,6 +33,14 @@ Changes in BitBake 1.8.x:
33 - Improve runtime PREFERRED_PROVIDERS warning message 33 - Improve runtime PREFERRED_PROVIDERS warning message
34 - Add BB_STAMP_WHITELIST option which contains a list of stamps to ignore when 34 - Add BB_STAMP_WHITELIST option which contains a list of stamps to ignore when
35 checking stamp dependencies and using a BB_STAMP_POLICY of "whitelist" 35 checking stamp dependencies and using a BB_STAMP_POLICY of "whitelist"
36 - No longer weight providers on the basis of a package being "already staged". This
37 leads to builds being non-deterministic.
38 - Flush stdout/stderr before forking to fix duplicate console output
39 - Make sure recrdeps tasks include all inter-task dependencies of a given fn
40 - Add bb.runqueue.check_stamp_fn() for use by packaged-staging
41 - Add PERSISTENT_DIR to store the PersistData in a persistent
42 directory != the cache dir.
43 - Add md5 and sha256 checksum generation functions to utils.py
36 44
37Changes in BitBake 1.8.10: 45Changes in BitBake 1.8.10:
38 - Psyco is available only for x86 - do not use it on other architectures. 46 - Psyco is available only for x86 - do not use it on other architectures.
diff --git a/bitbake/lib/bb/persist_data.py b/bitbake/lib/bb/persist_data.py
index 3103805ce1..79e7448bee 100644
--- a/bitbake/lib/bb/persist_data.py
+++ b/bitbake/lib/bb/persist_data.py
@@ -43,9 +43,9 @@ class PersistData:
43 Why sqlite? It handles all the locking issues for us. 43 Why sqlite? It handles all the locking issues for us.
44 """ 44 """
45 def __init__(self, d): 45 def __init__(self, d):
46 self.cachedir = bb.data.getVar("CACHE", d, True) 46 self.cachedir = bb.data.getVar("PERSISTENT_DIR", d, True) or bb.data.getVar("CACHE", d, True)
47 if self.cachedir in [None, '']: 47 if self.cachedir in [None, '']:
48 bb.msg.fatal(bb.msg.domain.PersistData, "Please set the 'CACHE' variable.") 48 bb.msg.fatal(bb.msg.domain.PersistData, "Please set the 'PERSISTENT_DIR' or 'CACHE' variable.")
49 try: 49 try:
50 os.stat(self.cachedir) 50 os.stat(self.cachedir)
51 except OSError: 51 except OSError:
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py
index cb0ca3ff24..0ad5876ef0 100644
--- a/bitbake/lib/bb/providers.py
+++ b/bitbake/lib/bb/providers.py
@@ -213,34 +213,6 @@ def _filterProviders(providers, item, cfgData, dataCache):
213 eligible.remove(fn) 213 eligible.remove(fn)
214 eligible = [fn] + eligible 214 eligible = [fn] + eligible
215 215
216 # look to see if one of them is already staged, or marked as preferred.
217 # if so, bump it to the head of the queue
218 for p in providers:
219 pn = dataCache.pkg_fn[p]
220 pe, pv, pr = dataCache.pkg_pepvpr[p]
221
222 stamp = '%s.do_populate_staging' % dataCache.stamp[p]
223 if os.path.exists(stamp):
224 (newvers, fn) = preferred_versions[pn]
225 if not fn in eligible:
226 # package was made ineligible by already-failed check
227 continue
228 oldver = "%s-%s" % (pv, pr)
229 if pe > 0:
230 oldver = "%s:%s" % (pe, oldver)
231 newver = "%s-%s" % (newvers[1], newvers[2])
232 if newvers[0] > 0:
233 newver = "%s:%s" % (newvers[0], newver)
234 if (newver != oldver):
235 extra_chat = "%s (%s) already staged but upgrading to %s to satisfy %s" % (pn, oldver, newver, item)
236 else:
237 extra_chat = "Selecting already-staged %s (%s) to satisfy %s" % (pn, oldver, item)
238
239 bb.msg.note(2, bb.msg.domain.Provider, "%s" % extra_chat)
240 eligible.remove(fn)
241 eligible = [fn] + eligible
242 break
243
244 return eligible 216 return eligible
245 217
246 218
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index b9c1399efe..b697cee536 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -164,6 +164,12 @@ class RunQueue:
164 taskname = self.runq_task[task] 164 taskname = self.runq_task[task]
165 return "%s, %s" % (fn, taskname) 165 return "%s, %s" % (fn, taskname)
166 166
167 def get_task_id(self, fnid, taskname):
168 for listid in range(len(self.runq_fnid)):
169 if self.runq_fnid[listid] == fnid and self.runq_task[listid] == taskname:
170 return listid
171 return None
172
167 def circular_depchains_handler(self, tasks): 173 def circular_depchains_handler(self, tasks):
168 """ 174 """
169 Some tasks aren't buildable, likely due to circular dependency issues. 175 Some tasks aren't buildable, likely due to circular dependency issues.
@@ -398,8 +404,12 @@ class RunQueue:
398 return [] 404 return []
399 if task in recursive_tdepends: 405 if task in recursive_tdepends:
400 return recursive_tdepends[task] 406 return recursive_tdepends[task]
401 rectdepends = [task] 407
402 nextdeps = [task] 408 fnid = taskData.tasks_fnid[task]
409 taskids = taskData.gettask_ids(fnid)
410
411 rectdepends = taskids
412 nextdeps = taskids
403 while len(nextdeps) != 0: 413 while len(nextdeps) != 0:
404 newdeps = [] 414 newdeps = []
405 for nextdep in nextdeps: 415 for nextdep in nextdeps:
@@ -776,7 +786,7 @@ class RunQueue:
776 bb.fatal("check_stamps fatal internal error") 786 bb.fatal("check_stamps fatal internal error")
777 return current 787 return current
778 788
779 def check_stamp(self, task): 789 def check_stamp_task(self, task):
780 790
781 if self.stamppolicy == "perfile": 791 if self.stamppolicy == "perfile":
782 fulldeptree = False 792 fulldeptree = False
@@ -791,10 +801,12 @@ class RunQueue:
791 stampfile = "%s.%s" % (self.dataCache.stamp[fn], taskname) 801 stampfile = "%s.%s" % (self.dataCache.stamp[fn], taskname)
792 # If the stamp is missing its not current 802 # If the stamp is missing its not current
793 if not os.access(stampfile, os.F_OK): 803 if not os.access(stampfile, os.F_OK):
804 bb.msg.debug(2, bb.msg.domain.RunQueue, "Stampfile %s not available\n" % stampfile)
794 return False 805 return False
795 # If its a 'nostamp' task, it's not current 806 # If its a 'nostamp' task, it's not current
796 taskdep = self.dataCache.task_deps[fn] 807 taskdep = self.dataCache.task_deps[fn]
797 if 'nostamp' in taskdep and task in taskdep['nostamp']: 808 if 'nostamp' in taskdep and task in taskdep['nostamp']:
809 bb.msg.debug(2, bb.msg.domain.RunQueue, "%s.%s is nostamp\n" % (fn, taskname))
798 return False 810 return False
799 811
800 iscurrent = True 812 iscurrent = True
@@ -808,8 +820,10 @@ class RunQueue:
808 try: 820 try:
809 t2 = os.stat(stampfile2)[stat.ST_MTIME] 821 t2 = os.stat(stampfile2)[stat.ST_MTIME]
810 if t1 < t2: 822 if t1 < t2:
823 bb.msg.debug(2, bb.msg.domain.RunQueue, "Stampfile %s < %s" % (stampfile,stampfile2))
811 iscurrent = False 824 iscurrent = False
812 except: 825 except:
826 bb.msg.debug(2, bb.msg.domain.RunQueue, "Exception reading %s for %s" % (stampfile2 ,stampfile))
813 iscurrent = False 827 iscurrent = False
814 828
815 return iscurrent 829 return iscurrent
@@ -907,7 +921,7 @@ class RunQueue:
907 fn = self.taskData.fn_index[self.runq_fnid[task]] 921 fn = self.taskData.fn_index[self.runq_fnid[task]]
908 922
909 taskname = self.runq_task[task] 923 taskname = self.runq_task[task]
910 if self.check_stamp(task): 924 if self.check_stamp_task(task):
911 bb.msg.debug(2, bb.msg.domain.RunQueue, "Stamp current task %s (%s)" % (task, self.get_user_idstring(task))) 925 bb.msg.debug(2, bb.msg.domain.RunQueue, "Stamp current task %s (%s)" % (task, self.get_user_idstring(task)))
912 self.runq_running[task] = 1 926 self.runq_running[task] = 1
913 self.task_complete(task) 927 self.task_complete(task)
@@ -916,6 +930,8 @@ class RunQueue:
916 continue 930 continue
917 931
918 bb.msg.note(1, bb.msg.domain.RunQueue, "Running task %d of %d (ID: %s, %s)" % (self.stats.completed + self.active_builds + 1, len(self.runq_fnid), task, self.get_user_idstring(task))) 932 bb.msg.note(1, bb.msg.domain.RunQueue, "Running task %d of %d (ID: %s, %s)" % (self.stats.completed + self.active_builds + 1, len(self.runq_fnid), task, self.get_user_idstring(task)))
933 sys.stdout.flush()
934 sys.stderr.flush()
919 try: 935 try:
920 pid = os.fork() 936 pid = os.fork()
921 except OSError, e: 937 except OSError, e:
@@ -930,7 +946,8 @@ class RunQueue:
930 newsi = os.open('/dev/null', os.O_RDWR) 946 newsi = os.open('/dev/null', os.O_RDWR)
931 os.dup2(newsi, sys.stdin.fileno()) 947 os.dup2(newsi, sys.stdin.fileno())
932 self.cooker.configuration.cmd = taskname[3:] 948 self.cooker.configuration.cmd = taskname[3:]
933 try: 949 bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", self, self.cooker.configuration.data)
950 try:
934 self.cooker.tryBuild(fn) 951 self.cooker.tryBuild(fn)
935 except bb.build.EventException: 952 except bb.build.EventException:
936 bb.msg.error(bb.msg.domain.Build, "Build of " + fn + " " + taskname + " failed") 953 bb.msg.error(bb.msg.domain.Build, "Build of " + fn + " " + taskname + " failed")
@@ -1023,3 +1040,13 @@ class RunQueue:
1023 self.runq_weight[task], 1040 self.runq_weight[task],
1024 self.runq_depends[task], 1041 self.runq_depends[task],
1025 self.runq_revdeps[task])) 1042 self.runq_revdeps[task]))
1043
1044
1045def check_stamp_fn(fn, taskname, d):
1046 rq = bb.data.getVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", d)
1047 fnid = rq.taskData.getfn_id(fn)
1048 taskid = rq.get_task_id(fnid, taskname)
1049 if taskid is not None:
1050 return rq.check_stamp_task(taskid)
1051 return None
1052
diff --git a/bitbake/lib/bb/taskdata.py b/bitbake/lib/bb/taskdata.py
index 0fb34ad748..566614ee63 100644
--- a/bitbake/lib/bb/taskdata.py
+++ b/bitbake/lib/bb/taskdata.py
@@ -91,6 +91,16 @@ class TaskData:
91 91
92 return self.fn_index.index(name) 92 return self.fn_index.index(name)
93 93
94 def gettask_ids(self, fnid):
95 """
96 Return an array of the ID numbers matching a given fnid.
97 """
98 ids = []
99 if fnid in self.tasks_lookup:
100 for task in self.tasks_lookup[fnid]:
101 ids.append(self.tasks_lookup[fnid][task])
102 return ids
103
94 def gettask_id(self, fn, task, create = True): 104 def gettask_id(self, fn, task, create = True):
95 """ 105 """
96 Return an ID number for the task matching fn and task. 106 Return an ID number for the task matching fn and task.