1 |
Hello, |
2 |
|
3 |
As you may or may not know, right now env-update calls 'ldconfig' |
4 |
by default, describing that in the terms of 'Regenerating |
5 |
/etc/ld.so.cache'. In fact, it does a little more -- it updates library |
6 |
symlinks to use the newest library version available. |
7 |
|
8 |
In other words, if we've got libfoo.so.1.1 and .1.2 with the same |
9 |
SONAME, and libfoo.so.1 symlinks to .1.1, ldconfig would replace that |
10 |
by a symlink to .1.2. |
11 |
|
12 |
This seems to be the major cause of the problems with portage's |
13 |
preserve-libs feature. When a package is downgraded, portage replaces |
14 |
the SONAME symlink with an older version to make newly-built packages |
15 |
use that older version, and preserves the newer libraries not to break |
16 |
linkage. |
17 |
|
18 |
But a short while later, ldconfig takes over the symlink and makes it |
19 |
point to the newer version once again. Packages still link to the newer |
20 |
version and the only way to get the library actually downgraded is to |
21 |
remove the preserved library. Thus, it's even worse than without |
22 |
preserved-libs. |
23 |
|
24 |
On the other hand, that ldconfig behavior seems completely redundant |
25 |
as packages are installed with .so symlinks anyway. And I think that if |
26 |
package manager installs those symlinks, it should manage them itself |
27 |
instead of letting external tools mangle with PM-installed files. |
28 |
|
29 |
I have created a patch which makes 'env-update' always pass '-X' to |
30 |
ldconfig, to not let it update the symlinks in system-wide libdirs. I'm |
31 |
testing it right now to see if it doesn't cause any breakage. |
32 |
|
33 |
If that causes problems (i.e. some packages don't actually create |
34 |
correct .so symlinks themselves), I guess we could decide to call |
35 |
'ldconfig -N -n' in post-install operations, like the deprecated |
36 |
'preplib' helper does. |
37 |
|
38 |
This way, the symlinks will be completely controlled by the Package |
39 |
Manager and the preserve-libs feature should handle downgrades just |
40 |
fine. |
41 |
|
42 |
And I've just downgraded libav, and rebuilt mplayer2 against it with |
43 |
the newer version being preserved just fine. |
44 |
|
45 |
-- |
46 |
Best regards, |
47 |
Michał Górny |