[Haskell-cafe] Experiments in Haskell Packaging

Sanket Agrawal sanket.agrawal at gmail.com
Thu Jan 5 02:35:42 CET 2012

Hi Chris,

Is it possible to also make the GHC and haskell platform distributions
available as relocatable rpms, instead of HUB packaging? The reason is that
for some of us, when we work in complex production environment which has
its own deployment procedures, we have to deploy it differently. A
hard-coded path like /usr/hs won't work, and a packaging environment that
depends on that hard-coded path won't work either in that case.

I actually downloaded RHEL5 GHC binary rpm from justhub.org, and unpacked
it using rpm2cpio. Then, I ended up doing grep and sed to replace all
occurrences of "/usr/hs" with the path I installed it in. It worked well
except for some caveats - some of the binary/data files such as *.hi seem
to have the hard-coded path in them. That hasn't caused any issues so far,
except for haddock which fails if gcc is called since it is coded to
/usr/hs/bin/gcc (though haddock bash shell has right gcc path coded in it -
I guess it ignores it in favor of the path in some binary file).

It will be very nice to have what I did above, as relocatable rpms, and
without HUB dependency. That will help with, I suspect, reducing the
duplication of efforts when some of us, who want to use haskell at work,
end up compiling our own binaries for RHEL platform (since glibc on RHEL
5/6 is older than what ghc-pwd demands). I tried to compile GHC 7.4 on RHEL
5, but it failed to link because of some GHC bug. That is how I ended up
using your compiled binary with my grep/sed hack. It was a great
time-saver. Thank you for doing this work.


On Tue, Jan 3, 2012 at 7:49 AM, Chris Dornan <chris at chrisdornan.com> wrote:

> 'Antoine Latter' <aslatter at gmail.com>:
> > All of this is in my head, but assuming I already had some sort of
> > Linux build-server set up, it would be nice to combine it with your
> > work to make it easier to have the build-server run tests against
> > multiple versions of GHC/HP. That's all I was getting at.
> Working within the Hub framework this is straightforward. If you are using
> public releases rather than special builds of the tools then it should be
> quite easy.
> Supposing you needed to test with Haskell Platform 2011.2.0.1 and
> hexpat-0.19.7:
>        # install the platform (probably done already)
>        sudo yum install haskell-platform-2011.2.0.1-hub
>       # create new hub 'test-2011.2.0.1' based this HP
>       hub init 2011.2.0.1 test-2011.2.0.1
>       # install hexpat-0.19.7 into it
>       hub install-into test-2011.2.0.1 hexpat-2011.2.0.1
> Repeat as necessary to create your array of test environments.
> Now you just have to arrange select the appropriate hub for each test.
> Suppose the environment variable $testhubs contains all of your test hubs
> ('test-2011.2.0.1', etc.), then the following shell command would prime the
> tools to successively use each of the test environments on each invocation
>  of make.
>        for h in $testhubs; do HUB=$h make; done
> Note that the justhub distribution isn't necessary for this -- you can do
> it manually.
> But it does make it easier.
> Chris
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120104/0b40ebb3/attachment.htm>

More information about the Haskell-Cafe mailing list