aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Larson <clarson@mvista.com>2009-07-17 15:26:45 -0700
committerChris Larson <clarson@mvista.com>2009-07-21 16:20:05 -0700
commitfccae58a704543c86f936dde5c1ba026fadfaabe (patch)
tree5c012e4cd7794c4e5cc1d5ae8e2533ef80391f40
parentc3d58e612592e8128f946cb94bb25d85ad9d171e (diff)
downloadbitbake-contrib-fccae58a704543c86f936dde5c1ba026fadfaabe.tar.gz
taskdata: fix a possible infinite loop when multiple eligible providers aren't buildable
The code which removes providers which aren't buildable from the eligible list modifies the list while iterating it, resulting in skipping some entries. If the list contained two failed providers in sequence, it left the second behind in the eligible list. Fixed by replacing the block with a list comprehension that constructs a new eligible list without the failed entries. Signed-off-by: Chris Larson <clarson@mvista.com>
-rw-r--r--lib/bb/taskdata.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/bb/taskdata.py b/lib/bb/taskdata.py
index 52a4f4e64..73ec2aa75 100644
--- a/lib/bb/taskdata.py
+++ b/lib/bb/taskdata.py
@@ -373,11 +373,7 @@ class TaskData:
all_p = dataCache.providers[item]
eligible, foundUnique = bb.providers.filterProviders(all_p, item, cfgData, dataCache)
-
- for p in eligible:
- fnid = self.getfn_id(p)
- if fnid in self.failed_fnids:
- eligible.remove(p)
+ eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
if not eligible:
bb.msg.note(2, bb.msg.domain.Provider, "No buildable provider PROVIDES '%s' but '%s' DEPENDS on or otherwise requires it. Enable debugging and see earlier logs to find unbuildable providers." % (item, self.get_dependees_str(item)))
@@ -425,11 +421,7 @@ class TaskData:
raise bb.providers.NoRProvider(item)
eligible, numberPreferred = bb.providers.filterProvidersRunTime(all_p, item, cfgData, dataCache)
-
- for p in eligible:
- fnid = self.getfn_id(p)
- if fnid in self.failed_fnids:
- eligible.remove(p)
+ eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
if not eligible:
bb.msg.error(bb.msg.domain.Provider, "'%s' RDEPENDS/RRECOMMENDS or otherwise requires the runtime entity '%s' but it wasn't found in any PACKAGE or RPROVIDES variables of any buildable targets.\nEnable debugging and see earlier logs to find unbuildable targets." % (self.get_rdependees_str(item), item))