Skip site navigation (1) Skip section navigation (2)

Re: Postgresql8.4 install breaks Evolution on Ubuntu 9.10

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Sachin Srivastava <sachin(dot)srivastava(at)enterprisedb(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Postgresql8.4 install breaks Evolution on Ubuntu 9.10
Date: 2009-11-30 02:52:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Magnus Hagander wrote:
> On Sun, Nov 29, 2009 at 16:18, Sachin Srivastava
> <sachin(dot)srivastava(at)enterprisedb(dot)com> wrote:
>> Libraries the One-Click installer tramples all over include:
>>    libxml2
>>    libssl
>>    libcrypto
>>    libreadline
>>    libtermcap
>>    libuuid
>> Apart from libxml2 (which is now being fixed) all other libraries you
>> mentioned , dint get installed (or copied) to the PGHOME/lib directory if
>> the same name library already present in the system (/lib and /usr/lib).
> What happens if they are installed by the packaging system later on?
> Won't that cause a conflict then?

What if the libraries installed by the system package manager have been
built with different options that render them incompatible with the
shipped PostgreSQL binaries? Possibly subtly so, with crashes or data
corruption down the track rather than immediate and obvious failure?

(Arguably the soname should be changed in this case, but in practice the
soname just isn't sufficient for this sort of thing - you need some kind
of "build key" and there's no support in GNU ld and for such).

I'd say "ffs, just enable rpath" but for the fact that without a wee bit
more work it doesn't handle moving binaries around very well. Mac OS X's
"@executable_path" runtime linker path substitution doesn't seem to have
a standard equivalent on general *nix. Thankfully, GNU does offer
a similar runtime path substitution - the ${ORIGIN} variable. From the manpage:

     understands the string $ORIGIN (or equivalently
              ${ORIGIN}) in an  rpath  specification  to  mean  the
              directory   containing  the  application  executable.
              Thus, an application located in somedir/app could  be
              compiled with gcc -Wl,-rpath,'$ORIGIN/../lib' so that
              it finds an associated shared library in  somedir/lib
              no  matter  where somedir is located in the directory

(There's also some other good stuff under "RPATH TOKEN EXPANSION". If
you haven't read the entirety of the and ld man pages, you need to
do so *now* if you're packaging apps for binary distribution).

Note that you can build without rpath, or with normal rpaths, and change
them later using the commonly-available chrpath too. For that matter,
you can skip using $ORIGIN and just use a bundled copy of chrpath to set
rpaths on your binaries at install-time.

So, please, please, PLEASE start using rpath linkage and stop adding
your lib dir to ! This problem has been around - and solved -
for a very long time, and you'd be much better off using the existing
well-established and robust solutions rather than rolling your own
dangerous workarounds.

Craig Ringer

In response to

pgsql-general by date

Next:From: Eduardo PiombinoDate: 2009-11-30 04:51:33
Subject: Re: Date with time zone
Previous:From: Adrian KlaverDate: 2009-11-29 23:23:08
Subject: Re: Date with time zone

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group