Genetic Thinking

Managing Haskell packages with Cabal

Posted in Haskell by dfornika on September 15, 2011

So I’ve been pushing ahead with my polyphred-hxt module, getting close to being able to read a full polyphred XML output into a Haskell data structure.

Unfortunately, I’ve run into the Haskell version of the dreaded ‘dll hell.’ It looks like somewhere along the process of installing packages with cabal, I’ve introduced some sort of circular dependency problems. If I try to install a package, I get an error message like this:

Resolving dependencies...
Configuring hxt-9.1.4...
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
package parsec-3.1.0 requires mtl-1.1.0.2
package parsec-3.1.0 requires mtl-2.0.1.0
package network-2.3.0.5 requires parsec-3.1.0
package hxt-9.1.4 requires parsec-3.1.0
package hxt-regex-xmlschema-9.0.1 requires parsec-3.1.0
Preprocessing library hxt-9.1.4...
Building hxt-9.1.4...
<command line>: cannot satisfy -package-id hxt-regex-xmlschema-9.0.1-f09d85e10827d6e27f0e5aa6d987d810: 
    hxt-regex-xmlschema-9.0.1-f09d85e10827d6e27f0e5aa6d987d810 is unusable due to missing or recursive dependencies:
      parsec-3.1.0-ab7296039e6a7884eadf028e04fd8eab
    (use -v for more information)
cabal: Error: some packages failed to install:
hxt-9.1.4 failed during the building phase. The exception was:
ExitFailure 1

Yikes!

Fortunately (or unfortunately!?) I’m not the only one who is running into problems like this. After some searching, I ran across this blog post on ‘Sententia cdsmithus‘:

http://cdsmith.wordpress.com/2011/01/21/a-recap-about-cabal-and-haskell-libraries/

It looks to me like I’ve become a victim of “The Butterfly Effect.” Normally, anything related to chaos or complexity theory fascinates me, but this is just frustrating!

while Cabal and GHC are fine with multiple packages existing having different versions, they are not okay with multiple packages have the same name and version, but different dependencies. As a result, one can end up in a situation where installing a package breaks another package.

There are a couple suggestions in the article that I think will help my situation. The first is to use cabal-dev to manage a separate package database for my polyphred-xml project, and the second is not to use the system package manager (apt-get in my case, I’m on Debian 6.0) to install haskell packages.

Wish me luck, and check out my Patch-Tag repo if you have ideas to contribute.

About these ads
Tagged with:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: