Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 590514 - sys-apps/portage: sub-optimal merge order triggered by PDEPEND and runtime dependency cycles
Summary: sys-apps/portage: sub-optimal merge order triggered by PDEPEND and runtime de...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 155723 604854
  Show dependency tree
 
Reported: 2016-08-04 22:04 UTC by Zac Medico
Modified: 2023-06-16 05:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2016-08-04 22:04:34 UTC
There is a misbehavior in the depgraph._serialize_tasks method, where PDEPEND can cause the runtime cycle code to merge a very large runtime cycle and its dependencies, even though it would be more optimal to merge the dependencies first. In the main "while mygraph:" loop, the problem occurs when the prefer_asap flag is True, and there's a node in the asap_nodes list. The smallest_cycle variable ends up with a large runtime cycle along with some dependencies that are not involved in the cycle (which should therefore be merged earlier than the rest).
Comment 1 Zac Medico gentoo-dev 2016-08-04 22:18:28 UTC
Some existing relevant code is visible in these commits, but apparently it doesn't always work as intended:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=603569311daee6e2460051f46728a05cbae66880
https://gitweb.gentoo.org/proj/portage.git/commit/?id=075ce106b3ae1e55cc810b4c946deea83bcb4a8e
Comment 2 Zac Medico gentoo-dev 2016-08-05 02:16:53 UTC
I have a working patch in the following branch:

https://github.com/zmedico/portage/tree/bug_590514

I'll submit it for review after I've added a test case.
Comment 5 Zac Medico gentoo-dev 2017-02-10 18:49:50 UTC
Fixed in portage-2.3.3.