[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How do people manage cabal vs deb packages?

Joachim Breitner <nomeata@debian.org> writes:

> Am Montag, den 07.12.2009, 15:05 +1100 schrieb Erik de Castro Lopo:
>> Does anybody use both debian and cabal installed packages? I know I
>> definitely prefer debian packages but some stuff, like contributing
>> to upstream packages, just really needs cabal-install.
> I just use cabal install as a user.

Likewise, combined with calling "cabal configure" with --global when I
want to test against only the Debian packages.

Historically I had nightmarish problems with diamond dependencies
resulting from different regex-compat and time packages in Debian and
hackage.  I haven't had this lately -- I think because instead of

    cabal install foo

I do

    cabal install --dry-run foo

And then manually meet as many dependencies as I can from Debian instead
of hackage.  This way, cabal-install never installs newer versions of
time or regex-compat, it just uses the slightly older ones from Debian.

It's also helpful that "cabal upgrade" no longer provides a one-step
shoot-myself-in-the-foot way to get diamond dependency conflicts between
Hackage and Debian.

> This does not interfere with package building (or at least it should
> not :-) and is quick and dirty. If something goes wrong, I just delete
> the relevant parts of ~/.cabal and ~/.ghc and start over.

I used to do that, but I worked out that ghc-pkg unregister (test with
ghc-pkg list) is simpler than rm -rf'ing -- particularly since I usually
forget about ~/.ghc/.

There's also ghc-pkg hide and expose, which I think are better than
unregister, but I haven't used them yet.

PS: here's how I share ~/.cabal/ between different architectures:

    $ egrep -v '^[[:space:]]*(--|$)' ~/.cabal/config
    remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
    remote-repo-cache: /home/twb/.cache/cabal
    documentation: True
    build-summary: /home/twb/.cabal/logs/build.log
    remote-build-reporting: anonymous
    install-dirs user
      bindir: $prefix/bin-$arch
      libdir: $prefix/lib-$arch
    install-dirs global

    $ grep cabal ~/.bash_profile
    export PATH=~/.cabal/bin-`uname -m`:"$PATH"

    $ ls -ld ~/.cabal/bin-*
    ~/.cabal/bin-armv5tel -> bin-arm
    ~/.cabal/bin-i686 -> bin-i386

Reply to: