[Haskell-cafe] server directory layout for cabal-install?

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Mar 19 06:36:01 EDT 2009

On Wed, 2009-03-18 at 22:24 +0100, Johannes Waldmann wrote:
> Hello.
> I wonder what is the required layout of directories
> and files on a server that supplies packages for cabal-install.
> I figure 00-index.tar.gz contains the *.cabal files.

Right. The directory layout within the index is important too at the

> (The cabal files have to be on the server as well, unpacked?)

They do not have to be, it just makes it easy to construct the index

find . -maxdepth 3 -name '*.cabal' | tar -c -T - -f - | gzip -9 >$tmp

> Each $dir/$foo.cabal (in the archive) contains a "Version:$ver" line,
> and then $dir/$foo-$ver.tar.gz  must be on the server?
> Are there additional constraints on the $dir part?

In the 00-index.tar file the layout is


and on the server it must be


I think in future we'll want to relax this layout slightly. I think what
we want is to have the location in the index file match the location on
the server (ie relative to the base url) but we do not need a rigid
directory layout. That can be chosen as it suits.

See, currently cabal-install relies on the name of the .cabal file in
the index being the name and version of the package. It does not
actually parse the .cabal file unless it has to (it's a bit slow).
That's not really ideal of course. The solution is to parse just enough
to extract the name and version and then the file name doesn't matter so
much (except for the .cabal file extension).

> What is the syntax of the .cabal/config file? The standard entry is
> repos: hackage.haskell.org:http://hackage.haskell.org/packages/archive ,
> where the thing between "repos:" and ":http" is just a symbolic name,
> and I can add more lines like that?

Yes. The order in which they're listed determines the merge order of the
repo indexes. I think repos listed later override earlier repos (if they
happen to contain the same package name and version).


More information about the Haskell-Cafe mailing list