Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 631894

Summary: sys-apps/portage: depgraph _minimize_children method randomly chooses packages to eliminate
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: drobbins, esigra
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 155723, 631448    

Description Zac Medico gentoo-dev 2017-09-24 07:55:50 UTC
Daniel Robbins isolated the problem in the area of code:

> 	for pkg in pkgs:
> 		eliminate_pkg = True
> 		for atom in atom_pkg_graph.parent_nodes(pkg):
> 			if len(atom_pkg_graph.child_nodes(atom)) < 2:
> 				eliminate_pkg = False
> 				break
> 		if eliminate_pkg:
> 			atom_pkg_graph.remove(pkg)

The problem is that the order of iteration of the pkgs set is random. This causes packages to be removed from atom_pkg_graph in random order, and their removal affects the atom_pkg_graph.child_nodes(atom) results for packages processed in later iterations of the loop, leading to a random outcome.
Comment 3 Zac Medico gentoo-dev 2017-10-02 19:37:14 UTC
Released in 2.3.11.