Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: kde-base components blocking each other
Date: Sun, 07 Jun 2009 10:51:33
Message-Id: pan.2009.06.07.10.51.17@cox.net
In Reply to: Re: [gentoo-amd64] Re: kde-base components blocking each other by Martin Herrman
1 Martin Herrman <martin@×××××××.nl> posted
2 40bb8d3b0906070049g26add8e4s78bfa9da8285beda@××××××××××.com, excerpted
3 below, on Sun, 07 Jun 2009 09:49:28 +0200:
4
5 >> Note that newer versions of portage have /automatic/ blocker resolution
6 >> in many temporary cases, so depending on how old your portage is (of
7 >> course I'm on ~amd64 and have had 3.5.10 for months now, and don't know
8 >> if the feature is in stable portage yet), if at the --ask prompt, you
9 >> tell it to go ahead, it may well take care of everything for you
10 >> without you having to do anything else. =:^)
11 >
12 >
13 > in which version was this feature added? I just upgraded portage to
14 > 2.1.6.13 and could upgrade to 2.2.x, but that one is hard masked:
15 >
16 > http://www.gentoo-portage.com/sys-apps/portage
17
18 What happened there is that while 2.1.4 was current stable, 2.2 as the
19 next presumed stable series, with several new features, was made ~arch.
20
21 However, some of those features matured faster than others. Among them,
22 parallel merges (see below) and automatic blocker resolution (again, see
23 below). Others such as sets (you'll see my mention of @system and @world
24 below, tho I don't spend time on it or explain, see Zac's blog linked
25 below for more), and FEATURES=preserved-libs (nice idea in theory but was
26 breaking stuff due to originally poor implementation so I turned it off,
27 I'm not sure the current status) didn't mature quite as fast.
28
29 So Zac and the other portage folks decided to release an in-between
30 series starting with (IIRC) 2.1.5, that contained the more stable new
31 features from 2.2 (parallel merges and auto-blocker-resolution), while
32 omitting the ones that needed more work (sets, preserved-libs). The idea
33 was to have the new features that could go stable much faster. However,
34 that meant that they needed testers for the 2.1.5 series, that they
35 didn't have, since the usual testing group, ~arch users, were alreadly on
36 2.2.
37
38 So they hard-masked 2.2 so most ~arch users would fall back to the new
39 2.1.5 series, thus testing it well enough so it could be stabilized.
40 That's the status we have today. 2.2 is ~arch ready and in fact was
41 ~arch for a short period, until they decided they needed testers for the
42 new middle ground 2.1.5 series.
43
44 But, there was a problem. With 2.2 going ~arch, KDE moved KDE 4.2 (or
45 was it still 4.1 at the time?), to that point either out of tree or hard-
46 masked, to ~arch as well. The problem is that the official KDE-4
47 migration guide referred to and continues to refer to sets, a 2.2-only
48 feature at this point. So anyone who was using or testing ~arch KDE 4.2
49 and had followed the official migration guide using sets, had to either
50 unmask portage-2.2 when it went back hard-masked, or fiddle around trying
51 to figure out how to convert their previous set-merged kde-4.2 into a non-
52 set config.
53
54 The Gentoo/KDE-4 Migration Guide
55 http://www.gentoo.org/proj/en/desktop/kde/kde4-guide.xml
56
57 FWIW, while I'm still using KDE 3.5.10 as my "production" desktop, I've
58 been testing 4.x since before the original release. (FWIW, KDE-4 still
59 has problems in 4.2.x compared to later 3.5.x versions, at least for
60 those with older video cards like the Radeon 9200 I'm still running, but
61 it's /slowly/ getting there, and the later 4.2.x versions should be
62 decently usable for many with newer video -- or smaller displays, I'm
63 running 1920x2400, dual-stacked 1920x1200, and the Radeon 9200's OpenGL
64 maxes at 2048x2048, thus the issue here, as KDE-4 really needs OpenGL to
65 be worth the upgrade from KDE-3.) Thus, I had and have 4.2.x installed
66 as well -- using the upgrade guide and sets -- and had to unmask
67 portage-2.2 when it was masked to encourage ~arch users to test the new
68 2.1.5 series.
69
70 > I will now just give it a try: start to unmerge the blocked packages and
71 > update my system. We'll see :-)
72
73 Back to the blocked packages thing, versions, etc...
74
75 Note that with --ask (or --pretend), portage will still display the
76 blocks. It'll just manage them automatically if you say "y" at the --ask
77 prompt (or redo the emerge without the --pretend). That way, users can
78 see any potential for temporary "dependency gaps" as I mentioned and can
79 use their judgment and not try to do them right before that ever so
80 important presentation or whatever.
81
82 I was unsure of the precise version, but I did a quick bug search and
83 found a comment from Zac Medico (portage maintainer and release manager)
84 indicating that for the 2.1 series, it was added in 2.1.5.
85
86 http://bugs.gentoo.org/show_bug.cgi?id=224487#c1
87
88 As he says there:
89
90 >> With automatic blocker resolution like this, it should
91 >> be relatively rare for a user to encounter a blocker
92 >> that requires any manual intervention.
93
94 That comment references the blog entry where he explains the idea, here
95 (link wrap warning, but you can follow the link from the comment linked
96 above):
97
98 http://blogs.gentoo.org/zmedico/2008/05/09/
99 blocking_package_file_collisions
100
101 Zac's answers to some of the comments are interesting/informative/helpful
102 too. Note that portage's blocker resolution has gotten slightly more
103 complex since then. In particular, in ebuilds where !<pkg-atom>
104 originally indicated a blocker, that's still used if it's a normal
105 blocker that it's OK for portage to try to resolve automatically, while
106 !!<pkg-atom> is now used for complex blockers where portage must not try
107 to resolve it automatically because something's likely to go wrong.
108 Also, as noted in the blog, portage is more cautious about system
109 packages and its own dependencies, where doing the wrong thing could
110 leave the system temporarily unbootable or could kill portage itself,
111 thus making recovery much more problematic.
112
113 Also likely of interest if you've not paid too much attention recently,
114 and have a multi-cpu/multi-core system with a decent amount (say a gig a
115 core) of memory is the multiple package merges in parallel stuff, see the
116 "next" link at the blog. Matter of fact, browsing around the whole blog
117 and checking back for newer entries are both likely to be quite
118 informative/helpful, as well.
119
120 http://blogs.gentoo.org/zmedico/2008/07/23/portage_parallel_builds
121
122 I've been using the parallel jobs feature for some time now, and have
123 with experience developed some hints. First, as I said, it doesn't make
124 a lot of sense to use it for single cpu/core systems, or for those
125 sufficiently memory constrained (say < 1-gig/core) that resources are
126 already stretched, and may in fact increase merge times due to increased
127 swap usage or the like.
128
129 Second, --keep-going is quite nice. =:^) That way, when something fails,
130 portage continues other presently going merge jobs and then regenerates
131 its dependency graph without the failed package and tries again. Thus,
132 it installs as much as it can before failing with what it couldn't (and
133 anything depending on what failed), leaving far less to have to merge
134 later, after the issue with the failed package is resolved.
135
136 As for --jobs and --load-average, here's what I found. First, you
137 probably want to make these somewhat lower than the parallel MAKEOPTS
138 settings. (This assumes that you DO use both --load-average here and
139 -l in MAKEOPTS, if you just use --jobs and -j, adjust accordingly.)
140 Doing so means the system will first try to run more parallel jobs on
141 already running merges if it can, before the load drops to the point that
142 it starts on additional package merges as well. This helps limit memory
143 and other resource usage, particularly for those (like me) that have
144 PORTAGE_TMPDIR pointing at a tmpfs to speed emerges and minimize disk
145 access.
146
147 Second, because the unpack and configure steps are by nature not very
148 parallelized, what tends to happen is that in parallel mode, at first,
149 portage will start working on one package, decide the load average is
150 still low enough to do another... and another... and another... before
151 any of them actually get to the more parallelized compile phase. Also,
152 at times, there will be a bottleneck package which portage must wait on
153 because all further packages depend on it and must therefore wait until
154 it's installed before they can be merged. These two factors taken
155 together tend to mean that in practice, the emerges clump up, portage
156 will start several at a time before the load average gets high enough
157 that it doesn't start any more, then (even with a higher MAKEOPTS setting
158 than portage setting) when they hit the actual compile phase, it'll cap
159 at the MAKEOPTS limit for quite some time and not start anything else
160 until all or all but one of the packages are finished, then it'll start
161 several more... etc.
162
163 Third, and this is what took the most getting used to here, since several
164 packages are merging in parallel, it can't show the whole output for each
165 one as it used to. Instead, it shows a summary that shows when it starts
166 working on a package, when it starts installing a package, how many it
167 has completed, and how many total. It's actually pretty nice, but it did
168 take some getting used to. Meanwhile, it's still logging the actual
169 merges in the background, and if there's an error, it spits that info out
170 and tells you where to look for the log. Also, if you want to track the
171 progress of an individual package, you can use the tradition Unix tail -f
172 command in another terminal or whatever.
173
174 What I've done here is set it up so that my @system and @world update
175 helper scriptlets (example: eaw for emerge -aNuD @world) always use the
176 parallel merge options while ordinary single-package emerge helper
177 scriptlets (example: ea for emerge -a1) don't do the parallel thing. I
178 do however have a parallel variant scriptlet (eam, the m for multiplexed)
179 that does. That way, I can see the full output when I'm merging
180 individual packages, but for big jobs such as @world updates or if I'm
181 upgrading KDE, I use the parallel emerges functionality. I thus do NOT
182 have portage's --jobs, etc options set in EMERGE_DEFAULT_OPTS, because I
183 set it on the emerge command line as fed to it by the appropriate
184 scriptlet.
185
186 One caveat! Some packages require a LOT of memory for one particular
187 job. KDE-3's kmail (for monolithic package users I believe it's in
188 kdepim) is one example, using over a gig of memory for a single job at
189 one point in its compile, at least here. There are others. Also, while
190 portage honors its --load-average option, not all packages honor the -l
191 in makeopts. At least parts of qt-4 are this way. That can be bad when
192 it's only a single package emerging at once, but it's made much worse if
193 you've not allowed for it setting the portage parallel merge options and
194 portage has several merges going at once, at the same time. I've tended
195 to handle these as I find them by setting a lower MAKEOPTS=-j option
196 (while eliminating the -l they don't honor anyway) for them in the
197 appropriate /etc/portage/env/cat-egory/pkg file, thus overruling the
198 standard/global make.conf setting.
199
200 --
201 Duncan - List replies preferred. No HTML msgs.
202 "Every nonfree program has a lord, a master --
203 and if you use the program, he is your master." Richard Stallman