Help understanding a dependency conflict

I have a program that's using both json (0.4.4) and hslogger (1.1.0). During the "cabal configure" stage of compiling my program, I get this error message: Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package json-0.4.4 requires mtl-1.1.0.2 package hslogger-1.1.0 requires mtl-2.0.1.0 Looking at the .cabal files for json and hslogger, they both have dependencies on "mtl", but neither package gives a version for it. I only have mtl 2.0.1.0 installed, so installing json didn't bring in an old version of the library when it was installed. My program compiles and runs without any errors. Can anybody tell my why cabal thinks json needs mtl 1.1.0.2, and what I can do to make the message go away?

On Fri, 7 Jan 2011, tsuraan wrote:
I have a program that's using both json (0.4.4) and hslogger (1.1.0). During the "cabal configure" stage of compiling my program, I get this error message:
Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package json-0.4.4 requires mtl-1.1.0.2 package hslogger-1.1.0 requires mtl-2.0.1.0
Looking at the .cabal files for json and hslogger, they both have dependencies on "mtl", but neither package gives a version for it. I only have mtl 2.0.1.0 installed, so installing json didn't bring in an old version of the library when it was installed. My program compiles and runs without any errors. Can anybody tell my why cabal thinks json needs mtl 1.1.0.2, and what I can do to make the message go away?
Does any of the packages, that json and hslogger depend on, has more restricted version dependencies?

Does any of the packages, that json and hslogger depend on, has more restricted version dependencies?
From looking at the json.cabal file and assuming default build settings (I didn't touch them, anyhow), json depends on base, syb, array, containers, bytestring, mtl, parsec, and pretty. My ~/.cabal/lib only has an entry for mtl, so I assume the rest of the packages are build-in to haskell and are probably not dependent on mtl.
From the hslogger.cabal file, hslogger depends on network, mtl, unix, base, containers, directory, process, time, and old-locale. Of those, only mtl is on my ~/.cabal/lib file, so I assume again that nothing else depends on mtl.
Is there some way to have cabal (or some other ghc packaging program) tell me about dependencies, and what packages have brought in what other packages? I can't imagine that digging through .cabal files is the normal way to figure this out.

On Fri, 7 Jan 2011, tsuraan wrote:
Is there some way to have cabal (or some other ghc packaging program) tell me about dependencies, and what packages have brought in what other packages? I can't imagine that digging through .cabal files is the normal way to figure this out.
ghc-pkg describe yourpackage

Is there some way to have cabal (or some other ghc packaging program) tell me about dependencies, and what packages have brought in what other packages? I can't imagine that digging through .cabal files is the normal way to figure this out.
ghc-pkg describe yourpackage
Much more sane. "ghc-pkg describe json" lists mtl-1.1.0.2, but none of the other deps (array, base, bytestring, containers, parsec, pretty, syb) depend on mtl at all. It's especially strange that when I installed json through cabal it didn't have any problem using mtl-2, but now it's decided json wants mtl-1.

On Fri, Jan 7, 2011 at 1:56 PM, tsuraan
I have a program that's using both json (0.4.4) and hslogger (1.1.0). During the "cabal configure" stage of compiling my program, I get this error message:
Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package json-0.4.4 requires mtl-1.1.0.2 package hslogger-1.1.0 requires mtl-2.0.1.0
Looking at the .cabal files for json and hslogger, they both have dependencies on "mtl", but neither package gives a version for it. I only have mtl 2.0.1.0 installed, so installing json didn't bring in an old version of the library when it was installed. My program compiles and runs without any errors. Can anybody tell my why cabal thinks json needs mtl 1.1.0.2, and what I can do to make the message go away?
Is there a reason you need to make the warning go away? Maybe your installed version of parsec is built against mtl-1 - parsec is a dependency of json. Antoine
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Is there a reason you need to make the warning go away?
I'm a haskell newbie, and the build system is telling me I'm doing something that may break my program. I'd definitely be happier if the warning weren't there :)
Maybe your installed version of parsec is built against mtl-1 - parsec is a dependency of json.
ghc-pkg doesn't list mtl as a dependency of parsec. I didn't think I had mtl-1 installed (it's not in my .cabal directory), but now I see that it's part of the haskell base install. So now I'm wondering why cabal felt that it needed to install mtl-2 for hslogger, when I apparently already had mtl-1 installed, and hslogger doesn't list a version for its mtl dep. Is it because hslogger depends on base >= 4, while json depends on base >= 3? Does that sound like a probable cause?

ghc-pkg doesn't list mtl as a dependency of parsec. I didn't think I had mtl-1 installed (it's not in my .cabal directory), but now I see that it's part of the haskell base install. So now I'm wondering why cabal felt that it needed to install mtl-2 for hslogger, when I apparently already had mtl-1 installed, and hslogger doesn't list a version for its mtl dep. Is it because hslogger depends on base >= 4, while json depends on base >= 3? Does that sound like a probable cause?
I think that was the problem. I just did a new "cabal install json", and it installed it linking against mtl-2 instead of mtl-1, and the warning went away. So, I'm happy now, and I learned some new tools. yay!
participants (3)
-
Antoine Latter
-
Henning Thielemann
-
tsuraan