summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-03-28 15:09:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-03-28 15:09:50 +0100
commit12b163dbd81cafafec1ebe3c4039c65af60ee261 (patch)
treebb4b0aed62393b27c05d2a977b256be67c42be58 /bitbake/lib
parentafd28598368963dc49bfd02ef2d6f54218d663ae (diff)
downloadpoky-12b163dbd81cafafec1ebe3c4039c65af60ee261.tar.gz
bitbake/gcc: Enable a shared common source tree
This patch is a quick proof of concept to show how source code could be shared between recipes which use ${B} to have a separate build directory compared to source directory ${S}. Issues: a) gcc uses sed and creates config files against ${S} which means the directory should not be shared. Need to change the way that works. b) Could be extended to cover eglibc except there is a patch applied against nativesdk versions which again makes the source incompatible. c) Need to clean up the layout in work-shared and make a directory level deeper to ensure patch separation. d) clean task does not remove stamps Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/build.py4
-rw-r--r--bitbake/lib/bb/cache.py4
-rw-r--r--bitbake/lib/bb/runqueue.py8
3 files changed, 14 insertions, 2 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 83a378febb..19a9ba12f1 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -382,10 +382,10 @@ def stamp_internal(taskname, d, file_name):
382 taskflagname = taskname.replace("_setscene", "") 382 taskflagname = taskname.replace("_setscene", "")
383 383
384 if file_name: 384 if file_name:
385 stamp = d.stamp[file_name] 385 stamp = d.stamp_base[file_name].get(taskflagname) or d.stamp[file_name]
386 extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or "" 386 extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or ""
387 else: 387 else:
388 stamp = d.getVar('STAMP', True) 388 stamp = d.getVarFlag(taskflagname, 'stamp-base', True) or d.getVar('STAMP', True)
389 file_name = d.getVar('BB_FILENAME', True) 389 file_name = d.getVar('BB_FILENAME', True)
390 extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or "" 390 extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or ""
391 391
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index c56b4b4248..4e76857e6f 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -55,6 +55,7 @@ recipe_fields = (
55 'provides', 55 'provides',
56 'task_deps', 56 'task_deps',
57 'stamp', 57 'stamp',
58 'stamp_base',
58 'stamp_extrainfo', 59 'stamp_extrainfo',
59 'broken', 60 'broken',
60 'not_world', 61 'not_world',
@@ -160,6 +161,7 @@ class RecipeInfo(namedtuple('RecipeInfo', recipe_fields)):
160 broken = cls.getvar('BROKEN', metadata), 161 broken = cls.getvar('BROKEN', metadata),
161 not_world = cls.getvar('EXCLUDE_FROM_WORLD', metadata), 162 not_world = cls.getvar('EXCLUDE_FROM_WORLD', metadata),
162 stamp = cls.getvar('STAMP', metadata), 163 stamp = cls.getvar('STAMP', metadata),
164 stamp_base = cls.flaglist('stamp-base', tasks, metadata),
163 stamp_extrainfo = cls.flaglist('stamp-extra-info', tasks, metadata), 165 stamp_extrainfo = cls.flaglist('stamp-extra-info', tasks, metadata),
164 packages_dynamic = cls.listvar('PACKAGES_DYNAMIC', metadata), 166 packages_dynamic = cls.listvar('PACKAGES_DYNAMIC', metadata),
165 depends = cls.depvar('DEPENDS', metadata), 167 depends = cls.depvar('DEPENDS', metadata),
@@ -579,6 +581,7 @@ class CacheData(object):
579 self.task_queues = {} 581 self.task_queues = {}
580 self.task_deps = {} 582 self.task_deps = {}
581 self.stamp = {} 583 self.stamp = {}
584 self.stamp_base = {}
582 self.stamp_extrainfo = {} 585 self.stamp_extrainfo = {}
583 self.preferred = {} 586 self.preferred = {}
584 self.tasks = {} 587 self.tasks = {}
@@ -604,6 +607,7 @@ class CacheData(object):
604 self.pkg_pepvpr[fn] = (info.pe, info.pv, info.pr) 607 self.pkg_pepvpr[fn] = (info.pe, info.pv, info.pr)
605 self.pkg_dp[fn] = info.defaultpref 608 self.pkg_dp[fn] = info.defaultpref
606 self.stamp[fn] = info.stamp 609 self.stamp[fn] = info.stamp
610 self.stamp_base[fn] = info.stamp_base
607 self.stamp_extrainfo[fn] = info.stamp_extrainfo 611 self.stamp_extrainfo[fn] = info.stamp_extrainfo
608 612
609 provides = [info.pn] 613 provides = [info.pn]
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 3db083b261..cb9e462869 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -105,6 +105,11 @@ class RunQueueScheduler(object):
105 if self.rq.runq_running[taskid] == 1: 105 if self.rq.runq_running[taskid] == 1:
106 continue 106 continue
107 if self.rq.runq_buildable[taskid] == 1: 107 if self.rq.runq_buildable[taskid] == 1:
108 fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[taskid]]
109 taskname = self.rqdata.runq_task[taskid]
110 stamp = bb.build.stampfile(taskname, self.rqdata.dataCache, fn)
111 if stamp in self.rq.build_stamps.values():
112 continue
108 return taskid 113 return taskid
109 114
110 def next(self): 115 def next(self):
@@ -1010,6 +1015,7 @@ class RunQueueExecute:
1010 self.runq_complete = [] 1015 self.runq_complete = []
1011 self.build_pids = {} 1016 self.build_pids = {}
1012 self.build_pipes = {} 1017 self.build_pipes = {}
1018 self.build_stamps = {}
1013 self.failed_fnids = [] 1019 self.failed_fnids = []
1014 1020
1015 def runqueue_process_waitpid(self): 1021 def runqueue_process_waitpid(self):
@@ -1024,6 +1030,7 @@ class RunQueueExecute:
1024 del self.build_pids[result[0]] 1030 del self.build_pids[result[0]]
1025 self.build_pipes[result[0]].close() 1031 self.build_pipes[result[0]].close()
1026 del self.build_pipes[result[0]] 1032 del self.build_pipes[result[0]]
1033 del self.build_stamps[result[0]]
1027 if result[1] != 0: 1034 if result[1] != 0:
1028 self.task_fail(task, result[1]>>8) 1035 self.task_fail(task, result[1]>>8)
1029 else: 1036 else:
@@ -1312,6 +1319,7 @@ class RunQueueExecuteTasks(RunQueueExecute):
1312 1319
1313 self.build_pids[pid] = task 1320 self.build_pids[pid] = task
1314 self.build_pipes[pid] = runQueuePipe(pipein, pipeout, self.cfgData) 1321 self.build_pipes[pid] = runQueuePipe(pipein, pipeout, self.cfgData)
1322 self.build_stamps[pid] = bb.build.stampfile(taskname, self.rqdata.dataCache, fn)
1315 self.runq_running[task] = 1 1323 self.runq_running[task] = 1
1316 self.stats.taskActive() 1324 self.stats.taskActive()
1317 if self.stats.active < self.number_tasks: 1325 if self.stats.active < self.number_tasks: