circular_dependency: fix ridiculously long loop
authorZac Medico <zmedico@gentoo.org>
Sun, 10 Jul 2011 01:26:26 +0000 (18:26 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 10 Jul 2011 01:26:26 +0000 (18:26 -0700)
The flags from REQUIRED_USE were added to affecting_use, which was not
really necessary and was a bad idea because a number of flags in
affecting_use affects our number of loops exponentially. This will fix
bug #374397 in which the large number of flags in the REQUIRED_USE of
dev-lang/php-5.3.6-r1 triggered execution of 2 ^ 45 loops.

pym/_emerge/resolver/circular_dependency.py

index 994e2022dfa3889df3b237e2c88c271716ac1738..cb64962f2b827d1764f4195744a9cba5d68b0e28 100644 (file)
@@ -138,17 +138,7 @@ class circular_dependency_handler(object):
                        usemask, useforce = self._get_use_mask_and_force(parent)
                        autounmask_changes = self._get_autounmask_changes(parent)
                        untouchable_flags = frozenset(chain(usemask, useforce, autounmask_changes))
-
                        affecting_use.difference_update(untouchable_flags)
-
-                       #If any of the flags we're going to touch is in REQUIRED_USE, add all
-                       #other flags in REQUIRED_USE to affecting_use, to not lose any solution.
-                       required_use_flags = get_required_use_flags(parent.metadata["REQUIRED_USE"])
-
-                       if affecting_use.intersection(required_use_flags):
-                               affecting_use.update(required_use_flags)
-                               affecting_use.difference_update(untouchable_flags)
-
                        affecting_use = tuple(affecting_use)
 
                        if not affecting_use: