Cabal sandboxes to test a package on hackage requiring a version of base I don't have

StackOverflow https://stackoverflow.com/questions/21962576

  •  15-10-2022
  •  | 
  •  

Question

I was reading this:

http://devskypers.blogspot.fr/2014/02/logging-flow-activity.html

And wanting to try.

A simple cabal install monad-journal tells me that I have base 4.6.0.1 but monad-journal requires 4.5.*.

I was hoping a sandbox could help, but sandboxes seem only to be for my own packages, and even then I don't really understand how it manages things. I tried making a simple cabal file for an empty package and get the note:

Note: when using a sandbox, all packages are required to have consistent dependencies. Try reinstalling/unregistering the offending packages or recreating the sandbox.

Is there any simple way to say "Install this package, and any dependencies it has, in my local sandbox so I can play around with it, ignoring whatever else I might have globally installed"? I tried --shadow-installed-packages as suggested here, but I get the same error.

Was it helpful?

Solution

The trouble with base (and a couple of other packages) is that they are tied to the GHC version you have. You can't simply install a different version of base, with or without sandboxes.

cabal HEAD has a flag --allow-newer which should help in this case. Or just bug the maintainer of monad-journal to relax version bounds.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top