Haskell cabal sandbox how to install packages?

I want if someone tells me the steps necessary to install gloss-examples in a sandbox along with all its dependencies. Here is what I tried to do:

I downloaded the gloss-examples package from hackage .

When I ran the command, going to ~/gloss/gloss-examples-1.9.4.1

 ~/gloss/gloss-examples-1.9.4.1$cabal sandbox init 

it succeeded, so I issued a team

 ~/gloss/gloss-examples-1.9.4.1$cabal install --only-dependencies 

but then I got the following errors:

 Resolving dependencies... cabal: Could not resolve dependencies: trying: gloss-examples-1.9.4.1 (user goal) next goal: base (dependency of gloss-examples-1.9.4.1) rejecting: base-4.5.0.0/installed-c8e... (conflict: gloss-examples => base==4.8.*) rejecting: base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable package requires installed instance) Dependency tree exhaustively searched. Note: when using a sandbox, all packages are required to have consistent dependencies. Try reinstalling/unregistering the offending packages or recreating the sandbox. 

How can I install this gloss-examples package and all its dependencies only in the sandbox? I think I understand that the cabal sandbox allows you to install any arbitrary package with all the dependencies (some or all of them contradict globally installed packages) installed in a separate directory. Is it possible? I think something is missing. Is this a suitable use case for cabal sandbox? Seeing the following

Note: when using a sandbox, all packages are required to have consistent dependencies.

Is there a difference between conflicting dependencies and not consistent dependencies ?

I tried many tutorials, including this , but couldn't figure out how to use the cabal sandbox.

+1
haskell sandbox cabal
source share
1 answer

It seems to me that you downloaded the version of gloss-examples , which is incompatible with your version of the base library. There are two ways to fix this:

  • Download a version (presumably an older one) compatible with your base library. The Hackage package content page has a long list of available versions near the top. It is also possible to use cabal fetch for this. I'm not sure.

  • Update GHC to get a new base . Usually you cannot update base without updating GHC.

+2
source share

All Articles