Thursday, October 14, 2010

Hacking together a working version of Haskell Platform 2010.2 for GHC 7.1

I don't know if GHC developers typically attempt to bring up a full, cabal-install based setup around development versions of the compiler, but that's what I wanted. To that end I hacked up a modified version of Haskell Platform 2010.2 that works with GHC 7.1.20101014. This is a recent version of GHC that includes, among other things:
  • Major run time improvements: namely, a BLACKHOLE fix that greatly improve parallel performance in some cases, relative to 6.12.
  • The LLVM backend.
  • The new type inference engine.
The modified version of Haskell Platform can be downloaded from the link below. You should be able to build it against a recent GHC that you can grab from the nightly snapshots (try 2010.10.14 to be safe). If that doesn't work, you can download my own build of the compiler below (Linux 64 bit) which is inflexible and needs to be unpacked in /opt/. I'm including links to download it with or without the platform pre-installed:
After that you should be ready for installing other software via "cabal install".

The modified haskell platform tarball contains my notes on the hacks that were necessary, copied below:

I did a few hacks to get this working with GHC 7.1.20101014

First was to upgrade the MTL package to a slightly newer version,
downloaded from Hackage. Ditto for deepseq.

The second was to hack the .cabal file in haskell-src to be less
picky about upperbounds on version numbers.

But I still ran into compile problems with haskell-src. (And there's
no new version of it released at the moment to upgrade to.) Namely, I
got the following compile error:

Could not find module `Data.Generics.Instances':
Use -v to see a list of the files searched for.

Ok, I included "syb" in the list of packages.

Next, build error on quickcheck... upgraded to
But that didn't fix the problem -- "split" is still undefined.

The package 'parallel' had to be loosened up to tolerate newer containers versions.

HTTP complained about wanting base 3... but why was the "old-base"
flag set anyway?

Ditto zlib.

Finally, the cabal-install package also required some relaxation of
version numbers, and worse it seems like the type of a library
function has changed from a Maybe result to a definite one.

Here I had to make a choice between updating to cabal-install 0.9.2
or hacking the 0.8.2 version. It works to add an "fmap Just" to get
0.8.2 to build, and besides the 0.9.2 version I have is actually just
the darcs head -- there hasn't been a release yet.

After picking the hacked 0.8.2 version, `make` succeeded for my
modified haskell-platform-2010.2.