[Haskell-cafe] Cabal bug? (was Re: Cabal: --enable-shared and executables)
Magnus Therning
magnus at therning.org
Tue Nov 5 05:53:40 UTC 2013
On Sun, Nov 03, 2013 at 05:05:40PM -0500, Albert Y. C. Lai wrote:
> On 13-11-03 01:46 AM, Magnus Therning wrote:
>>Is there already a way to get Cabal to put in an RPATH such that an
>>*installed* executable works correctly, or is this a fairly serious
>>bug in Cabal?
>
> It is usually desirable to set RPATH to libs' installation locations
> rather than libs' build trees, and I think I prefer it too. But the
> exception is during "cabal test", when you should test against libs
> in the build tree. It is somewhat a dilemma.
Indeed, that is a bit of a problem. However, I'd argue that
/installation/ of a package is the scenario to make as simple as
possible. Forcing the use of LD_LIBRARY_PATH in order to run `cabal
test` is much more acceptable to me than forcing its use to run an
installed executable.
> It is, in fact, sad that we have to set RPATH at all, and we have to
> because Haskell libs are not common, and they are not dumped
> directly into /usr/lib and /usr/local/lib. (They are, instead,
> scattered over /usr/local/lib/p-n/ghc-m, for wide ranges of values
> of p, n, and m.) If not for this, we would set no RPATH, we would do
> nothing special for installations, and we just had to play with
> LD_LIBRARY_PATH or LD_RUN_PATH or something during testing.
>
> (I would, in fact, not mind that organization, if symlinks were set
> up directly in /usr/local/lib. Note: the filename is already
> libHSp-n-ghcm.so, it already records p, n, and m, there is no clash
> putting that name right into /usr/local/lib alongside siblings and
> cousins --- well, no more clash than the /usr/local/lib/p-n/ghc-m
> scheme.)
We have have been considering a scheme like this when packaging for
Arch Haskell (inofficial packages for Arch Linux). Something along
the lines of putting symlinks in /usr/lib/ghc-7.6.3/ and then drop a
file in /etc/ld.so.conf.d/ that adds it to the runtime linker's search
path.
/M
--
Magnus Therning OpenPGP: 0xAB4DFBA4
email: magnus at therning.org jabber: magnus at therning.org
twitter: magthe http://therning.org/magnus
The day after tomorrow is the third day of the rest of your life.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131105/bcadb8fe/attachment.sig>
More information about the Haskell-Cafe
mailing list