[arch-haskell] RFC: A new tool for dependencies

Magnus Therning magnus at therning.org
Tue Jan 11 09:20:18 CET 2011


The last few days I've been thinking a bit about dependencies among our
packages in HABS.  My belief is that it would be beneficial to be able
to very
quickly see whether a set of packages is consistent in dependencies and
therefore ought to compile.  Now I may be wrong about this, which is why I'm
asking for comments early on.  I've only spent about an hour hacking on this
so far, I'm confident such a tool is possible (actually rather easy) to
make.  So, please comment before I waste too much time on something that in
fact is useless!

The central part is a database of tuples: <name, version, dependencies>.
Initially it's populated with the packages that GHC come with (base, array,
etc).  After that it would basically be used something like this:

    % pkgdb add
http://hackage.haskell.org/packages/archive/dataenc/0.13.0.1/dataenc.cabal
    Package added, all dependencies satisfied.
    % pkgdb add
http://hackage.haskell.org/packages/archive/dataenc/0.13.0.4/dataenc.cabal
    Package added, all dependencies satisfied.
    % pkgdb add
http://hackage.haskell.org/packages/archive/nanoparsec/0.1/nanoparsec.cabal
    Package not added, the following dependencies not satisfied
      ListLike ==2.0.*
      base >=4.3 && <5
    % pkgdb deps dataenc
    array >=0.1.0 && <0.4
    base >=3.0.0 && <4.4
    containers >=0.1.0 && <0.5
    % pkgdb reqby base
    dataenc

In short, it would make sure that the set of packages in the database is
consistent at all times, and it would offer some querying functionality.

Some problems:
  - not all CABAL files specify the complete set of dependencies (as
    highlighted in a few bug on cabal2arch[1])
  - dependencies on non-Haskell packages isn't tracked, so it's very
possible
    to add a package to the database that wouldn't actually compile on
an Arch
    system because a C library is of the wrong version

Possible extensions:
  - hooking it up to cabal2arch (e.g. by generating output that can be
    consumed by it) for generating PKGBUILDs and .install files

So, what are your thoughts.  Should I continue hacking on this?

/M


[1] https://github.com/archhaskell/cabal2arch/issues#issue/22
-- 
Magnus Therning                      OpenPGP: 0xAB4DFBA4
email: magnus at therning.org   jabber: magnus at therning.org
twitter: magthe               http://therning.org/magnus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/arch-haskell/attachments/20110111/2baa5f89/attachment.pgp>


More information about the arch-haskell mailing list