From 2be3f829e9913a0ac42b6abd6c698838ba029ad0 Mon Sep 17 00:00:00 2001 From: David James Date: Wed, 21 Jul 2010 14:17:05 -0700 Subject: [PATCH] Fix infinite recursion in PrebuiltsReady when graph is cyclic. Our package graph is cyclic, so parallel_emerge needs to handle cycles correctly in all cases. PrebuiltsReady should only need to check each package once, so we should set cache[pkg] to True if we found the package in the cache. TEST=Ran build_packages --fast BUG=none Review URL: http://codereview.chromium.org/3047009 --- parallel_emerge | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parallel_emerge b/parallel_emerge index 5b09ec6e42..971e6a30b3 100755 --- a/parallel_emerge +++ b/parallel_emerge @@ -819,11 +819,12 @@ class DepGraphGenerator(object): if pkg not in pkg_db: cache[pkg] = False else: + cache[pkg] = True for dep in deps_map[pkg]["needs"]: if not PrebuiltsReady(dep, pkg_db, cache): cache[pkg] = False break - return cache.setdefault(pkg, True) + return cache[pkg] def LastModifiedWithDeps(pkg, pkg_db, cache): """Calculate the last modified time of a package and its dependencies.