[arch-haskell] Tips for re-compiling system

Magnus Therning magnus at therning.org
Fri Jun 26 18:50:16 EDT 2009

Don Stewart wrote:
> magnus:
>> adam vogt wrote:
>>> On Fri, Jun 26, 2009 at 11:46 AM, Magnus Therning<magnus at therning.org> wrote:
>>>> By building haskell packages as I need them I've now managed to get
>>>> into a sitution where I need to do some re-compilation in order for my
>>>> system to make sense again.  Are there any handy scripts, or tips for
>>>> how to do a recompilation of Arch packages from AUR for solving this?
>>> I think we need something like this:
>>> http://code.haskell.org/gentoo/haskell-updater/
>>> but for arch too.
>> Yes, that seems to be useful.  Is there some description of the steps it  
>> performs, or is the code all the docs available?
> We can use cabal to extract a topological ordering for a set of packages btw.

I did some preliminary research on this, but before I start coding I thought
I'd run it by some people who are likely to know better :-)  I might be
underestimating the difficulty of the problem here.

After upgrading GHC (e.g. 6.10.2 -> 6.10.3) it's fairly easy to pick out
packages that aren't compiled against the new version.  Thanks to GHC's
excellent support for installing versions side by side one can look at the
${package-install-dir}-${version} to check that the versions match up.  Would
this be good enough?  Is there an easier way?  Would there ever be a need to
recompile packages after upgrading to a new arch-package version (e.g.
6.10.3-1 -> 6.10.3-2)?

To check if package A needs to be recompiled because one of its dependencies
has been upgraded it ought to be enough to check all its dependencies, they
are versioned in GHC's package.conf, against what is installed.  Packages that
depend on A should probably also be re-built.  Would that cover it?

Finding and parsing package.conf is easy.  However, for finding the version of
GHC there are some options:

     1. run `ghc --version` and parse output --- guaranteed
     2. check System.Info.compilerVersion, but that only give the major version
     (6.10.3 -> [6,10]) --- not good enough
     3. check the version of the package named 'ghc'

If option 3 is guaranteed to work then I think I'd prefer it.  Any comments?


Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/arch-haskell/attachments/20090626/01406a2a/signature.bin

More information about the arch-haskell mailing list