Managing Haskell packages with Cabal
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-18.104.22.168 package parsec-3.1.0 requires mtl-22.214.171.124 package network-126.96.36.199 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
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‘:
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.