gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Framework shlib versioning


From: Nicola Pero
Subject: Re: [PATCH] Framework shlib versioning
Date: Tue, 27 Jan 2004 22:29:08 +0000 (GMT)

> Btw, at this point I'm curious and I'd like to know how this is done on
> Apple.  If you make release 1.5.3 and install it, would that overwrite the
> resources of already-installed release 1.5.2 ?

I've looked into this, and Apple has a sort of open policy, but there is a 
caveat :-)

As usual, the problem arises because of Apple's habit of hardcoding
absolute/full paths in the linked objects.

The dynamic linker will remember exactly the path to the shared object
file.  That path will include 'Versions/XXX/' where 'XXX' is the version
used in the path.

So if the version used in the path is the full version (say, 1.5.2), then
something linked against 1.5.2 wouldn't work with 1.5.3 because the
dynamic linker would still look for {a_path}/Versions/1.5.2/{more_path},
and so wouldn't find 1.5.3 which is in
{a_path}/Versions/1.5.3/{more_path}.

So they use the shorter version (say, 1.5) in the path; but that doesn't
mean you can have 1.5.2 and 1.5.3 installed at the same time; it just
means when you install 1.5.3 it will overwrite 1.5.2 completely so in the
location where the dynamic linker used to find 1.5.2 it will now find
1.5.3 (of course the vice versa is true as well; if you install 1.5.2, it
will overwrite 1.5.3).

Really because the dynamic linker remembers the full path, and they don't
use symlinks, it simply means you can't have 1.5.2 and 1.5.3 installed at
the same time no matter what: if the path to the library object file has
to be the same between 1.5.2 and 1.5.3, and you don't use symlinks (which
they don't) either the path points to 1.5.2 or to 1.5.3, so you can't have
them installed at the same time.

On GNUstep we don't have this problem because we're using symlinks in the
Libraries directories, and the dynamic linker does *not* hardcode the full
path to the library object file (which is much better from this point of
view, and it's uglier from other points of view, as frameworks are no
longer encapsulated).

I wonder if they could have been a bit more clever with symlinks to make
it possible to install 1.5.2 and 1.5.3 at the same time (of course, only
one being used, like in unix libraries) while still having their
frameworks work properly and be encapsulated.  I guess it would be cool to
figure this bit out, and implement it for GNUstep. :-)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]