GHC 6.6 Launch

Author: Lennart Kolmodin <kolmodin@gentoo.org>, Gentoo Haskell Herd <haskell@gentoo.org>
Updated:2007-07-23

Due to the restructure of bundled libraries from GHC 6.4 -> 6.6 we've had to rewrite ebuild dependencies between packages and libraries. While doing this we have also taken the chance to do some updates we've been ponding on in the past.

This document describes some background on what's new in GHC 6.6 and the plan that has been carefully crafted on how to deal with it.

We have tried to summarize what the Gentoo Haskell Heard has been up to the past months (or year...).

1   Introduction

In GHC 6.4 a lot of packages where bundled with the compiler. In GHC 6.6 this has changed, all but the packages used by the compiler itself are now available as a separate download. That bundle is called ghc-extralibs.

This makes the GHC installation much faster, as you only compile the libs you need. Also, it gives the advantage that when you'd like to update a library, you only have to recompile exactly that one, instead of recompiling everything like before.

We have also merged the dev-lang/ghc-bin package into the dev-lang/ghc package, which you can get by using USE=binary. The ghc-bin tarball is used to bootstrap the source ghc compiler, instead of relying on a preinstalled compiler.

This can be modeled in Gentoo Linux' package management system, as we'll see next.

2   The plan

Each library in the ghc-extralibs will be represented by a separate package in the tree. Packages that can be compiled with GHC 6.6 (possibly also GHC 6.4) should depend on the modular libraries.

To mirror this behavior for GHC 6.4 where the compiler already provides the libraries, we use dummy libraries as place holders. They will not do or install anything, but merely exist to depended upon by packages that need those libraries. The dummy libraries will only depend on the GHC 6.4 compiler, while the real modular libs will depend on the GHC 6.6 series or newer. If an application/library is compiled against GHC 6.4 the dummy libraries will be used, and in the case of GHC 6.6 the modular libraries. This way it'll be easy to write the ebuilds, just depend on the libraries you need, regardless of compiler version.

Note though, packages that cannot be built with GHC 6.6 doesn't gain anything from depending on the modular libraries, as they are guarantied to all be dummy libraries. Thus there should be no requirement for those packages to use the modular libs.

3   Why merge ghc and ghc-bin?

It makes dependienceies simpler...:

DEPEND="=virtual/ghc-6.4* !>=virtual/ghc-6.6"

Assume the user has ghc-bin-6.4.2 which he (or she!) used to compile ghc-6.4.2, and then one day installs ghc-6.6. The first dependency will be satisfied by ghc-bin-6.4.2, but it's actually ghc-6.6 that's going to be used to compile the package! (as ghc has precedence to ghc-bin). The block makes sure this doesn't happen.

With ghc only available as one package, you can simply say:

DEPEND="=dev-lang/ghc-6.4*"

4   Step by step

The proposed actions of the scheme are listed below.

4.1   Add GHC 6.6 to the tree

This was done 7 March. It's p.masked.

4.2   ghc-bin

Update 2007-03-16: ghc-bin-6.6 in the tree, ~amd64 ~x86

Update 2007-04-12: cparrot has added ~alpha, ~ppc and ~sparc

Update 2007-07-23: the ghc-bin tarballs are usable, but the packages will go
away.

4.3   Add modular libs

Ie, only the modular libs from ghc-extralibs meant for GHC 6.6. They should also be p.masked.

Modular libs has been added for:

  • dev-haskell/arrows
  • dev-haskell/cgi
  • dev-haskell/fgl
  • dev-haskell/haskell-src
  • dev-haskell/html
  • dev-haskell/hunit
  • dev-haskell/mtl
  • dev-haskell/network
  • dev-haskell/quickcheck
  • dev-haskell/time
  • dev-haskell/xhtml
  • dev-haskell/alut
  • dev-haskell/glut
  • dev-haskell/openal
  • dev-haskell/opengl

Still missing for:

  • dev-havkell/hgl

4.4   Add dummy libs

The about 15 packages of ghc-extralibs has to be modeled as dummy libs too. They should be added as ~arch and then be stabilized by the arch teams asap.

The most common libs where added the 11th March, and have been marked as ~arch or stable on 2007-04-02:

  • dev-haskell/fgl-5.2
  • dev-haskell/mtl-1.0
  • dev-haskell/haskell-src-1.0
  • dev-haskell/html-1.0
  • dev-haskell/hunit-1.1
  • dev-haskell/network-1.0
  • dev-haskell/quickcheck-1.0

Dummies missing, just as all dummies, they only has to be added if an ebuild depends on that functionality:

  • dev-haskell/alut
  • dev-haskell/glut
  • dev-havkell/hgl
  • dev-haskell/openal
  • dev-haskell/opengl

4.5   Start rewrite other libs and apps to use the dummy libs

This is only required for applications that can be compiled with GHC 6.6, as described above.

Packages that today are marked as stable and can be compiled with GHC 6.6 requires that the dummy libraries are marked as stable too. Thus we have to start rewriting the other packages until the dummys has been marked stable.

4.6   Make new libs use the p.masked modular libs

Packages that only compiles with GHC 6.6 can be added to, if p.masked.

4.7   p.unmasking

  • update ghc-6.6.1 ebuild in portage from the overlay version
  • update ghc and cabal eclasses in portage from the overlay versions
  • merge any changes in the modular libs from the overlay
  • unmask ghc-6.6.1 and associated modular libs
  • put combined ghc-6.4.2 and 6.2.2 ebuilds into portage
  • mask ghc-bin asking people to move to ghc with USE=binary
  • make all other ebuilds depend on dev-lang/ghc rather than virtual/ghc
  • remove ghc-bin and the ghc virtual