Install Yesod Web-framework. Initialize project, then start it. Get an error:
cabal: The following installed packages are broken because other packages they
depend on are missing. These broken packages must be rebuilt before they can
be used.
package persistent-1.1.5.1 is broken due to missing package
aeson-0.6.2.0-0b5b1be15e07744226b068e794d3d16c
package persistent-postgresql-1.1.3.1 is broken due to missing package
aeson-0.6.2.0-0b5b1be15e07744226b068e794d3d16c
package persistent-template-1.1.3.1 is broken due to missing package
aeson-0.6.2.0-0b5b1be15e07744226b068e794d3d16c
package shakespeare-js-1.1.4.1 is broken due to missing package
aeson-0.6.2.0-0b5b1be15e07744226b068e794d3d16c
package yaml-0.8.5 is broken due to missing package
aeson-0.6.2.0-0b5b1be15e07744226b068e794d3d16c
But the aeson-0.6.2 package already installed:
cabal install aeson-0.6.2
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: aeson (user goal)
rejecting: aeson-0.6.2.0/installed-353..., 0.6.2.0, 0.6.1.0/installed-23c...,
0.6.1.0, 0.6.0.2, 0.6.0.1, 0.6.0.0, 0.5.0.0, 0.4.0.1, 0.4.0.0, 0.3.2.14,
0.3.2.13, 0.3.2.12, 0.3.2.11, 0.3.2.10, 0.3.2.9, 0.3.2.8, 0.3.2.7, 0.3.2.6,
0.3.2.5, 0.3.2.4, 0.3.2.3, 0.3.2.2, 0.3.2.1, 0.3.2.0, 0.3.1.1, 0.3.1.0,
0.3.0.0, 0.2.0.0, 0.1.0.0 (global constraint requires ==0.6.2)
How to resolve this problem?
Related
I am trying to install a Haskell program (itself a compiler for another programming language) from the Github repository.
The Elm compiler is itself a Haskell program and I would like to compile it from source:
$ cabal configure
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
trying: elm-0.19.1 (user goal)
next goal: zip-archive (dependency of elm-0.19.1)
Dependency tree exhaustively searched.
Trying configure anyway.
Configuring elm-0.19.1...
cabal: Encountered missing dependencies:
SHA -any,
ansi-terminal ==0.8.*,
ansi-wl-pprint >=0.6.8 && <0.7,
containers >=0.5.8.2 && <0.6,
If I try to use a different command the computer searches for a different version of the Elm programming language.
$ cabal install elm
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: Elm-0.13 (user goal)
trying: base-4.12.0.0/installed-4.1... (dependency of Elm-0.13)
next goal: transformers (dependency of Elm-0.13)
rejecting: transformers-0.5.6.2/installed-0.5..., transformers-0.6.0.2,
transformers-0.5.6.2, transformers-0.5.5.2, transformers-0.5.5.0,
transformers-0.5.4.0, transformers-0.5.2.0, transformers-0.5.1.0,
transformers-0.5.0.1, transformers-0.5.0.0 (conflict: Elm => transformers>=0.2
&& <0.5)
rejecting: transformers-0.4.3.0, transformers-0.4.2.0 (conflict:
I already have Elm installed globally and I would like to install a local copy that I cloned from Github. The cabal documentation doesn't say much.
Helpful information:
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5
$ cabal --version
cabal-install version 1.24.0.2
compiled using version 1.24.2.0 of the Cabal library
Trying different things possibly at risk:
$ cabal install --only-dependencies
Resolving dependencies...
internal error: could not construct a valid install plan.
The proposed (invalid) plan contained the following problems:
Package time is required by several packages, but they require inconsistent
versions:
package zip-archive-0.3.3 requires time-1.10
package snap-server-1.1.2.0 requires time-1.10
package snap-core-1.0.4.2 requires time-1.10
package io-streams-1.5.2.1 requires time-1.10
package http-client-0.6.4.1 requires time-1.10
package elm-0.19.1 requires time-1.10
package directory-1.3.6.2 requires time-1.10
package cookie-0.4.5 requires time-1.10
package HTTP-4000.3.16 requires time-1.10
package unix-2.7.2.2 requires time-1.8.0.2
Proposed plan:
Configured HTTP-4000.3.16 (.fake.HTTP-4000.3.16)
Configured SHA-1.6.4.4 (.fake.SHA-1.6.4.4)
Configured ansi-terminal-0.8.2 (.fake.ansi-terminal-0.8.2)
Configured ansi-wl-pprint-0.6.8.2 (.fake.ansi-wl-pprint-0.6.8.2)
Configured asn1-encoding-0.9.6 (.fake.asn1-encoding-0.9.6)
Configured asn1-parse-0.9.5 (.fake.asn1-parse-0.9.5)
Configured asn1-types-0.3.4 (.fake.asn1-types-0.3.4)
Your cabal is very old, and I strongly recommend you upgrade.
That said... with cabal-1, the invocation is simply
cabal install
with no elm at the end. Run it from within the directory you cloned from github that has a file named elm.cabal or similar -- it will automatically look for a file with extension .cabal and install the package described inside. cabal install will also take care of installing the missing dependencies.
With modern cabal, and assuming the executable named in the .cabal file is called elm, I would use
cabal run elm -- --args --for --elm --compiler
to run the compiler during testing, and then
cabal install --exe
when you are satisfied with your changes and want to make the executable available more widely.
Trying a nix build on nix-os:
cabal --enable-nix install
Resolving dependencies...
Configuring alex-3.2.4...
Configuring happy-1.19.9...
Configuring c2hs-0.28.3...
Building alex-3.2.4...
Building c2hs-0.28.3...
Building happy-1.19.9...
Installed alex-3.2.4
Installed happy-1.19.9
Installed c2hs-0.28.3
Configuring PathFinder-0.1.0.0...
Failed to install PathFinder-0.1.0.0
Build log ( /home/liminal18/.cabal/logs/ghc-7.10.3/PathFinder-0.1.0.0-Ct8hE4tpk2v4C0mK830b0v.log ):
cabal: Entering directory '.'
Configuring PathFinder-0.1.0.0...
cabal: The following package dependencies were requested
--dependency='alex=alex-3.2.4-EcO8GwV5VLDHmJwcir1l4u'
--dependency='c2hs=c2hs-0.28.3-ConONz4xJmFDgUCTAA6Wmq'
--dependency='happy=happy-1.19.9-4PZ32S6SvwZBaSXkci9sAS'
however the given installed package instance does not exist.
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
PathFinder-0.1.0.0-Ct8hE4tpk2v4C0mK830b0v failed during the configure step.
The exception was:
ExitFailure 1
I get the same error with out --enable-nix
cabal configure
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
trying: PathFinder-0.1.0.0 (user goal)
unknown package: c2hs (dependency of PathFinder-0.1.0.0)
fail (backjumping, conflict set: PathFinder, c2hs)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: PathFinder, c2hsTrying configure
anyway.
Configuring PathFinder-0.1.0.0...
cabal: Encountered missing dependencies:
alex -any, c2hs -any, happy -any
source code for the project is here:
https://github.com/aljones15/SimplePathFinding
I can do cabal install for c2hs just fine and the other dependencies however my build script just doesn't seem to work on nix-os. let me know if you can solve this. I think I just have something configured wrong.
In the cabal file, you should use the build-tool-depends field instead of build-depends for executables you depend on.
I'm trying to install aeson after resetting ~/.ghc and ~/.cabal.
cabal install aeson gives me the following error message:
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: aeson (user goal)
rejecting: aeson-0.9.0.1, 0.9.0.0, 0.8.1.1, 0.8.1.0 (global constraint
requires ==0.8.0.2)
trying: aeson-0.8.0.2
next goal: bytestring (user goal)
rejecting: bytestring-0.10.6.0, 0.10.4.1, 0.10.4.0, 0.10.2.0 (global
constraint requires installed instance)
rejecting: bytestring-0.10.0.2/installed-4f9... (conflict: aeson =>
bytestring>=0.10.4.0)
rejecting: bytestring-0.10.0.2, 0.10.0.1, 0.10.0.0, 0.9.2.1, 0.9.2.0,
0.9.1.10, 0.9.1.9, 0.9.1.8, 0.9.1.7, 0.9.1.6, 0.9.1.5, 0.9.1.4, 0.9.1.3,
0.9.1.2, 0.9.1.1, 0.9.1.0, 0.9.0.4, 0.9.0.3, 0.9.0.2, 0.9.0.1, 0.9 (global
constraint requires installed instance)
Dependency tree exhaustively searched.
The current version of bytestring package in my system is 0.10.2.0. I tried cabal install bytestring --reinstall so that I can have a more recent version of bytestring (thereby solving aeson dependency issue). But that returns a very odd error:
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: bytestring (user goal)
rejecting: bytestring-0.10.6.0, 0.10.4.1, 0.10.4.0, 0.10.2.0, 0.10.0.2,
0.10.0.1, 0.10.0.0, 0.9.2.1, 0.9.2.0, 0.9.1.10, 0.9.1.9, 0.9.1.8, 0.9.1.7,
0.9.1.6, 0.9.1.5, 0.9.1.4, 0.9.1.3, 0.9.1.2, 0.9.1.1, 0.9.1.0, 0.9.0.4,
0.9.0.3, 0.9.0.2, 0.9.0.1, 0.9 (global constraint requires installed instance)
Dependency tree exhaustively searched.
I can solve the problem by using sandboxes. But I'm interested to know if there is a nicer method resolve the dependency issue.
Update: Following a suggestion, I removed bytestring by ghc-pkg unregister --force bytestring, which broke some packages and am still not able to install aeson.
Following is the output of ghc-pkg list lists: http://lpaste.net/135108.
Where is your constraint (global constraint
requires ==0.8.0.2) coming from?
~/prog$ cd
~$ mkdir sbox
~$ cd sbox
~/sbox$ HOME=`pwd`
~$ export HOME
~$ cabal install bytestring
Config file path source is default config file.
Config file /home/novadenizen/sbox/.cabal/config not found.
Writing default configuration to /home/novadenizen/sbox/.cabal/config
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
cabal: There is no package named 'bytestring'.
You may need to run 'cabal update' to get the latest list of available
packages.
~$ cabal update
Downloading the latest package list from hackage.haskell.org
~$ cabal install aeson
Resolving dependencies...
Downloading bytestring-0.10.6.0...
Downloading dlist-0.7.1.1...
Configuring dlist-0.7.1.1...
Downloading syb-0.5.1...
Downloading transformers-0.4.3.0...
Configuring syb-0.5.1...
Building dlist-0.7.1.1...
Building syb-0.5.1...
Installed dlist-0.7.1.1
Configuring bytestring-0.10.6.0...
Building bytestring-0.10.6.0...
Configuring transformers-0.4.3.0...
Installed syb-0.5.1
Building transformers-0.4.3.0...
Installed transformers-0.4.3.0
Downloading mtl-2.2.1...
Downloading primitive-0.6...
Configuring primitive-0.6...
Building primitive-0.6...
Configuring mtl-2.2.1...
Installed primitive-0.6
Downloading vector-0.10.12.3...
Building mtl-2.2.1...
Configuring vector-0.10.12.3...
Installed mtl-2.2.1
Building vector-0.10.12.3...
Installed bytestring-0.10.6.0
Downloading binary-0.7.5.0...
Configuring binary-0.7.5.0...
Building binary-0.7.5.0...
Installed binary-0.7.5.0
Downloading text-1.2.1.1...
Configuring text-1.2.1.1...
Building text-1.2.1.1...
Installed vector-0.10.12.3
Installed text-1.2.1.1
Downloading hashable-1.2.3.2...
Configuring hashable-1.2.3.2...
Building hashable-1.2.3.2...
Installed hashable-1.2.3.2
Downloading scientific-0.3.3.8...
Downloading unordered-containers-0.2.5.1...
Configuring scientific-0.3.3.8...
Configuring unordered-containers-0.2.5.1...
Building scientific-0.3.3.8...
Building unordered-containers-0.2.5.1...
Installed scientific-0.3.3.8
Downloading attoparsec-0.13.0.0...
Configuring attoparsec-0.13.0.0...
Building attoparsec-0.13.0.0...
Installed unordered-containers-0.2.5.1
Installed attoparsec-0.13.0.0
Downloading aeson-0.9.0.1...
Configuring aeson-0.9.0.1...
Building aeson-0.9.0.1...
Installed aeson-0.9.0.1
~$
I just updated the haskel-plataform did a cabal update and was informed there is a new version of cabal-install that I should update to. So I do a cabal install cabal-install and get:
cabal: The following installed packages are broken because other packages they
depend on are missing. These broken packages must be rebuilt before they can
be used.
package random-1.0.1.1 is broken due to missing package
base-4.5.1.0-47f48c3ae7f8256a66a23e9dfe22eefc
cabal: Error: some packages failed to install:
cabal-install-1.16.0.2 failed during the configure step. The exception was:
ExitFailure 1
The thing is that If I do cabal install random, I see that that version of random is already installed:
=> cabal install random
Resolving dependencies...
All the requested packages are already installed:
random-1.0.1.1
I am at a loss at what is the problem or how to fix it
I get the following when trying to install Hlearn:
$ cabal install HLearn-distributions --ghc-options=-XConstraintKinds
Resolving dependencies...
Configuring HLearn-distributions-0.1.0.1...
Building HLearn-distributions-0.1.0.1...
Preprocessing library HLearn-distributions-0.1.0.1...
src\HLearn\Models\Distributions\Moments.hs:13:14:
Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
src\HLearn\Models\Distributions\Moments.hs:24:8:
Could not find module `GHC.TypeLits'
Perhaps you meant GHC.Types (needs flag -package ghc-prim)
Use -v to see a list of the files searched for.
cabal.exe: Error: some packages failed to install:
HLearn-distributions-0.1.0.1 failed during the building phase. The exception
was:
ExitFailure 1
I've tried installing the package using cabal (cabal install ghc-prim) but there's no such package. Also tried
$ cabal install HLearn-distributions --ghc-options=-XConstraintKinds -f-package ghc-prim
cabal.exe: There is no package named 'ghc-prim'.
You may need to run 'cabal update' to get the latest list of available
packages.
Any suggestions?
The module GHC.TypeLits is only available from base-4.6 on, with ghc-7.6.1.
I don't see any guards around the import, so the stated constraints on base in the build-depends are wrong in the versions 0.1.0.0 and 0.1.0.1.
If you want to install that package, you have to upgrade to ghc-7.6 or install a version < 0.1,
$ cabal-install "HLearn-distributions < 0.1"