Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 167450 - portage 2.1.2-r9, emerge order weird for --empty
Summary: portage 2.1.2-r9, emerge order weird for --empty
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks: 167107
  Show dependency tree
 
Reported: 2007-02-18 10:41 UTC by devsk
Modified: 2007-02-19 21:48 UTC (History)
0 users

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


Attachments
optimize merge order by delaying the merge of root nodes (delay_root_nodes.patch,909 bytes, patch)
2007-02-18 20:58 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description devsk 2007-02-18 10:41:05 UTC
$ emerge -pve bash

These are the packages that would be merged, in order:

Calculating dependencies  ..... ..... ... done!
[ebuild     U ] app-shells/bash-3.2_p9-r1 [3.1_p17] USE="-afs -bashlogger -nls -vanilla" 0 kB
[ebuild     U ] sys-libs/ncurses-5.6 [5.5-r3] USE="gpm -bootstrap -build -debug -doc -minimal -nocxx -trace -unicode" 0 kB
[ebuild   R   ] sys-libs/gpm-1.20.1-r5  USE="(-selinux)" 0 kB

Total: 3 packages (2 upgrades, 1 reinstall), Size of downloads: 0 kB

whereas in 2.1.1:

$ emerge -pev bash

These are the packages that would be merged, in order:

Calculating dependencies ... done!
[ebuild  N    ] sys-libs/gpm-1.20.1-r5  USE="(-selinux)" 0 kB
[ebuild  N    ] sys-libs/ncurses-5.6  USE="gpm -bootstrap -build -debug -doc -minimal -nocxx -trace -unicode" 0 kB
[ebuild  N    ] app-shells/bash-3.2_p9-r1  USE="-afs -bashlogger -nls -vanilla" 0 kB

Bash depends on ncurses, so ncurses should be emerged before bash under all circumstances. Why has this order changed in 2.1.2? I may be missing something about changes in 2.1.2 which has made this the right behavior. Please help me understand it.
Comment 1 Zac Medico gentoo-dev 2007-02-18 20:20:42 UTC
This behavior is triggered by a circular dependency between gpm and ncurses.  I'll see about improving the merge order calculation logic for cases like this.
Comment 2 Zac Medico gentoo-dev 2007-02-18 20:58:37 UTC
Created attachment 110583 [details, diff]
optimize merge order by delaying the merge of root nodes

With this patch, I get the following order:

[ebuild   R   ] sys-libs/ncurses-5.6
[ebuild   R   ] app-shells/bash-3.2_p9-r1
[ebuild   R   ] sys-libs/gpm-1.20.1-r5

Though this order is different from that produced by 2.1.1, it's just as good.   The difference is due to the building of a complete dependency graph (bug #147766).
Comment 3 Zac Medico gentoo-dev 2007-02-19 06:41:46 UTC
In svn r6010 I've optimized leaf node selection by ordering nodes from highest to lowest overall reference count.  This leads to the following merge order:

[ebuild   R   ] sys-libs/ncurses-5.6
[ebuild   R   ] sys-libs/gpm-1.20.1-r5
[ebuild   R   ] app-shells/bash-3.2_p9-r1
Comment 4 Zac Medico gentoo-dev 2007-02-19 21:48:57 UTC
This has been released in 2.1.2-r10.