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

Bug 608900

Summary: sys-apps/portage: emerge does does not spawn parallel builds when appropriate in some cases
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 184128    

Description Zac Medico gentoo-dev 2017-02-10 20:47:47 UTC
I notices that a large build with portage-2.3.3 was not spawning parallel builds when it seemed like it should, so I sent it a SIGUSR1 signal and poked around. I set a breakpoint before the break statement in the Scheduler._dependent_on_scheduled_merges method, and I found that it was failing to choose packages due to a dependency on ('ebuild', '/', 'sys-devel/gettext-0.19.7', 'merge', 'gentoo'), even though the package was neither in self._pkg_queue nor self._completed_tasks:

(Pdb) bt
-> retval = emerge_main()
-> return run_action(emerge_config)
-> retval = action_build(emerge_config, spinner=spinner)
-> retval = mergetask.merge()
-> rval = self._merge()
-> self._main_loop()
-> self._event_loop.iteration()
-> if self._run_timeouts():
-> if not x.function(*x.args):
-> self._schedule_tasks()
-> if self._schedule_tasks_imp():
-> pkg = self._choose_pkg()
-> if not self._dependent_on_scheduled_merges(pkg, later):
> /usr/lib64/python3.4/site-packages/_emerge/
-> dependent = True
(Pdb) p node
<Package ('ebuild', '/', 'sys-devel/gettext-0.19.7', 'merge', 'gentoo')>
(Pdb) p node in self._pkg_queue
(Pdb) p node in self._completed_tasks
(Pdb) p node in self._digraph

So, this one 'merge' node somehow got into the digraph, but not into the merge list. This prevents all of its parent nodes from being spawned as parallel builds.
Comment 1 Zac Medico gentoo-dev 2017-02-10 22:12:22 UTC
It turns out that the behavior that I observed was actually the designed behavior, because the sys-devel/gettext-0.19.7 package had been built but is was in the merge queue due to being a dependency of @system, as discussed in the FAQ (see bug 256616 and bug 259954):

So, gettext-0.19.7 was in an in-between state. It was no longer in self._pkg_queue and it was waiting to be merged, and it would be added to self._completed_tasks after it got merged.