[Haskell-cafe] Can cabal be turned into a package manager?

Ertugrul Söylemez es at ertes.de
Wed Dec 12 19:49:50 CET 2012


Rustom Mody <rustompmody at gmail.com> wrote:

> On Wed, Dec 12, 2012 at 11:25 PM, Ertugrul Söylemez <es at ertes.de>
> wrote:
>
> > "Janek S." <fremenzone at poczta.onet.pl> wrote:
> >
> > > In the recent months there was a lot of dicussion about cabal,
> > > dependency hell and alike. After reading some of these discussions
> > > there is a question I just have to ask:
> > >
> > > Why not create a package manager (like rpm or apt) for Haskell
> > > software?
> >
> > There is no need to reinvent that.  See below.
> >
> >
> > > I've been using Linux for years. Software for Linux is mostly
> > > written in C and C++. There are thousands of libraries with lots
> > > of dependencies and yet: a) Linux distributions manage to have
> > > package repositories that are kept in a consistent state b) Linux
> > > package managers can avoid dependency hell, automatically update
> > > to new packages, etc. Linux people did it! Is there any technical
> > > issue that prevents Haskell people from doing exactly the same
> > > thing? Or are we just having non-technical problems like lack of
> > > money or developers?
> >
> > Actually Linux distributions do all the hard work for you.  Package
> > maintainers know what I'm talking about.  It's a difficult task to
> > specify correct dependencies, tedious to negotiate with all the
> > other developers and all in all provide a consistent system.  But
> > that's only half of the story.
> >
> > The problem starts with the File Hierarchy Standard (FHS), which
> > essentially doesn't allow you to employ a more useful concept.
> > That's why an experimental (yet quite usable) Linux distribution
> > called NixOS [1] has established.  It recognizes the problems of the
> > FHS.  The solution is simple and radical:  the FHS sucks, so ignore
> > it.
> >
> > NixOS uses the Nix package manager, which you can also use for your
> > Haskell packages to escape from the dependency hell.  With Nix you
> > can even allow all users to install arbitrary packages without
> > interfering with other users, even the same packages with different
> > versions.  Two programs can depend on different versions of the same
> > library, etc. It's the package manager of the future.  Unfortunately
> > the concept is new and different enough that it will be difficult to
> > convince a large portion of the Linux community to employ it.  It's
> > the same issue Haskell has in the programming language world.
> >
> > There is no need to switch to NixOS to use Nix.  You can even
> > install it in your home directory.
> >
> > [1]: http://nixos.org/
>
> Thanks Ertugrul for mentioning nix.  My initial study of nix looked
> very promising as a solution to cabal-hell[2] but it seemed to suggest
> that one needs to change the whole OS!
>
> I must say that I am still dilly-dallying between cabal-dev
> virthualenv and nix and would appreciate a push!

I'm afraid the burden is that you would have to write the necessary Nix
expressions for your Haskell packages, so until we create a real Nix
channel for Hackage the barrier to entry is high.  But it's certainly
possible as a community project.

By the way, the Nix expressions can be derived from the Cabal
descriptions, at least for packages with the build type "Simple".  Even
for more complicated packages it should be very well possible.


> [2] I believe that saying cabal-hell is part of the problem with
> cabal-hell.  A more correct phrase may be
> "Haskell-has-no-standardized-package-manager-hell" (which is a bit
> long!)

It's commonly referred to as the "dependency hell".


Greets,
Ertugrul

-- 
Key-ID: E5DD8D11 "Ertugrul Soeylemez <es at ertes.de>"
FPrint: BD28 3E3F BE63 BADD 4157  9134 D56A 37FA E5DD 8D11
Keysrv: hkp://subkeys.pgp.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121212/d0e9dcff/attachment.pgp>


More information about the Haskell-Cafe mailing list