I'm trying to install the lens package to work with haskell.
$ haste-inst install lens
I get the following error:
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: base-4.6.0.1/installed-4.6... (user goal)
trying: containers-0.4.1.0/installed- (user goal)
trying: lens-4.9.1 (user goal)
next goal: template-haskell (dependency of lens-4.9.1)
rejecting: template-haskell-2.10.0.0 (conflict:
base==4.6.0.1/installed-4.6..., template-haskell => base==4.8.*)
rejecting: template-haskell-2.9.0.0 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base==4.7.*)
rejecting: template-haskell-2.8.0.0 (conflict: containers==0.4.1.0/installed-,
template-haskell => containers==0.5.*)
rejecting: template-haskell-2.7.0.0 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base==4.5.*)
rejecting: template-haskell-2.6.0.0 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base==4.4.*)
rejecting: template-haskell-2.5.0.0 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base==4.3.*)
rejecting: template-haskell-2.4.0.1 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base==4.2.*)
rejecting: template-haskell-2.4.0.0 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base>=3 && <4.3)
rejecting: template-haskell-2.3.0.1, 2.3.0.0, 2.2.0.0 (conflict: lens =>
template-haskell>=2.4 && <2.11)
Backjump limit reached (change with --max-backjumps).
Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.
I believe the sandbox "Note" to be misleading. The sandbox is new and base cannot exist in the sandbox anyway.
What determines the version of base for haste? Installing lens with cabal (for haskell) works fine:
cabal install lens
Edit:
lens-family has worked well as a substitute so far.
Lens depends on Template Haskell which, unfortunately, is not currently supported by Haste.
The way base is currently implemented for Haste makes TH support tricky. However, GHC 7.10 support will require some significant reshuffling anyway, so TH support will probably arrive together with 7.10.
Related
Versions
%cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library
%ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.7
Problem
I want to install weeder. If there is no *.cabal file in the current directory, running cabal install weeder succeeds. However, if the one exists and contains a dependency that conflicts with what weeder requires, cabal install weeder fails.
For example, if a .cabal file contains text < 1.2.3.0 as build-depends, cabal install weeder fails with the message below:
%cabal install weeder
cabal: Could not resolve dependencies:
[__0] trying: foobarbaz-0.1.0.0 (user goal)
[__1] next goal: text (dependency of foobarbaz)
[__1] rejecting: text-1.2.4.1/installed-1.2.4.1 (conflict: foobarbaz =>
text<1.2.3.0)
[__1] skipping: text-1.2.5.0, text-1.2.4.1, text-1.2.4.0, text-1.2.3.2,
text-1.2.3.1, text-1.2.3.0 (has the same characteristics that caused the
previous version to fail: excluded by constraint '<1.2.3.0' from 'foobarbaz')
[__1] trying: text-1.2.2.2
[__2] next goal: deepseq (dependency of text)
[__2] rejecting: deepseq-1.4.4.0/installed-1.4.4.0 (conflict: text =>
base>=4.2 && <4.11, deepseq => base==4.14.3.0/installed-4.14.3.0)
[__2] trying: deepseq-1.4.5.0
[__3] next goal: array (dependency of text)
[__3] rejecting: array-0.5.4.0/installed-0.5.4.0 (conflict: text => base>=4.2
&& <4.11, array => base==4.14.3.0/installed-4.14.3.0)
[__3] trying: array-0.5.4.0
[__4] next goal: base (dependency of foobarbaz)
[__4] rejecting: base-4.14.3.0/installed-4.14.3.0 (conflict: text => base>=4.2
&& <4.11)
[__4] skipping: base-4.16.0.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0,
base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
base-4.11.0.0 (has the same characteristics that caused the previous version
to fail: excluded by constraint '>=4.2 && <4.11' from 'text')
[__4] rejecting: base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
base-4.8.2.0, 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)
[__4] fail (backjumping, conflict set: base, foobarbaz, text)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, text, deepseq, array, foobarbaz
Try running with --minimize-conflict-set to improve the error message.
I can avoid this by mv foobarbaz.cabal foobarbaz.cabal.bk before cabal install weeder and mv foobarbaz.cabal.bk foobarbaz.cabal after the install, or running cabal install weeder in the other directory. But is there an option to ignore the local .cabal file?
Cabal has a --project-file option. It turns out that when specified empty, this causes cabal-install to not use any project file, even when one is in the current directory.
cabal v2-install --project-file="" weeder
After I posted the question, I found that the -z and --ignore-project options are also what I wanted.
cabal install -z weeder
I'm tring to install the package cabal-debian globally using cabal v2-install cabal-debian and get this error message:
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: base-4.12.0.0/installed-4.1... (user goal)
[__1] trying: binary-0.8.7.0 (user goal)
[__2] next goal: ghc (user goal)
[__2] rejecting: ghc-8.6.5/installed-8.6... (conflict: binary==0.8.7.0, ghc =>
binary==0.8.6.0/installed-0.8...)
[__2] trying: ghc-8.6.5
[__3] rejecting: ghc:-buildable (conflict: base==4.12.0.0/installed-4.1...,
ghc -buildable => base<0)
[__3] rejecting: ghc:+buildable (manual flag can only be changed explicitly)
[__3] fail (backjumping, conflict set: base, ghc, ghc:buildable)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: binary, base, ghc, ghc:buildable
Try running with --minimize-conflict-set to improve the error message.
I am using cabal 3.0.0.0 and have ghc 8.6.5 installed.
To me, this looks like you have a version of binary installed that isn't compatible with the boot libraries that come with the compiler. I recommend that you edit the file
~/.ghc/<something>-8.6.5/environments/default
and delete the line that mentions binary, then try again. (The <something> is almost certainly x86_64-linux.)
I am trying to install the sort package (Haskell), but it keeps failing even though I have the latest version of cabal.
So I updated my cabal : cabal update
But when I run cabal install sort, it failed. Then I tried to run it with --minimize-conflict-set, but it did not work as well. What can I do?
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: base-4.12.0.0/installed-4.1... (user goal)
[__1] next goal: binary (user goal)
[__1] rejecting: binary-0.8.7.0 (constraint from user target requires
==0.8.6.0)
[__1] trying: binary-0.8.6.0/installed-0.8...
[__2] next goal: containers (user goal)
[__2] rejecting: containers-0.6.2.1 (conflict: binary =>
containers==0.6.0.1/installed-0.6...)
[__2] rejecting: containers-0.6.1.1, containers-0.6.0.1/installed-0.6...,
containers-0.6.0.1, containers-0.5.11.0, containers-0.5.10.2,
containers-0.5.10.1, containers-0.5.9.2, containers-0.5.8.2,
containers-0.5.7.1, containers-0.5.7.0, containers-0.5.6.3,
containers-0.5.6.2, containers-0.5.6.1, containers-0.5.6.0,
containers-0.5.5.1, containers-0.5.5.0, containers-0.5.4.0,
containers-0.5.3.1, containers-0.5.3.0, containers-0.5.2.1,
containers-0.5.2.0, containers-0.5.1.0, containers-0.5.0.0,
containers-0.4.2.1, containers-0.4.2.0, containers-0.4.1.0,
containers-0.4.0.0, containers-0.3.0.0, containers-0.2.0.1,
containers-0.2.0.0, containers-0.1.0.1, containers-0.1.0.0,
containers-0.5.9.1, containers-0.5.8.1 (constraint from user target requires
==0.6.2.1)
[__2] fail (backjumping, conflict set: binary, containers)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: binary, containers, base, ghc
Try running with --minimize-conflict-set to improve the error message.
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: base-4.12.0.0/installed-4.1... (user goal)
[__1] trying: containers-0.6.2.1 (user goal)
[__2] next goal: ghc (user goal)
[__2] rejecting: ghc-8.6.5/installed-8.6... (conflict: containers==0.6.2.1,
ghc => containers==0.6.0.1/installed-0.6...)
[__2] rejecting: ghc-8.6.5 (conflict: base==4.12.0.0/installed-4.1..., ghc =>
base<0 && ==4.12.*)
[__2] rejecting: ghc-8.6.4, ghc-8.6.1, ghc-8.4.4, ghc-8.4.3, ghc-8.4.1,
ghc-8.2.2, ghc-8.2.1 (constraint from user target requires ==8.6.5)
[__2] fail (backjumping, conflict set: base, containers, ghc)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: containers, base, ghc
I'm trying to build my Hakyll site using Travis-CI. However, before I even get that far, I have a dependencies error when trying to install Hakyll as a dependency.
I can build Hakyll locally on my machine with no problems. What might be causing the dependency error, and how can it be resolved? Is there a way to resolve it without actually hard-coding each dependency version?
Here's the output that comes from TravisCI.
travis_fold:end:git.5
$ export PATH=/usr/local/ghc/$(ghc_find 7.6)/bin/:$PATH
travis_fold:start:cabal
$ cabal update
Config file path source is default config file.
Config file /home/travis/.cabal/config not found.
Writing default configuration to /home/travis/.cabal/config
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install
travis_fold:end:cabal
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
$ cabal --version
cabal-install version 1.18.0.2
using version 1.18.1 of the Cabal library
travis_fold:start:before_install.1
$ cabal update
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install
travis_fold:end:before_install.1
travis_fold:start:before_install.2
$ cabal install hakyll pandoc
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: hakyll-4.5.3.0 (user goal)
trying: base-4.6.0.1/installed-8aa... (dependency of hakyll-4.5.3.0)
trying: hakyll-4.5.3.0:+checkexternal
trying: http-conduit-2.1.2.3 (dependency of hakyll-4.5.3.0:+checkexternal)
trying: http-client-0.3.3.2 (dependency of http-conduit-2.1.2.3)
trying: exceptions-0.6.1 (dependency of http-client-0.3.3.2)
trying: transformers-0.4.1.0 (dependency of http-conduit-2.1.2.3)
next goal: mtl (dependency of hakyll-4.5.3.0)
rejecting: mtl-2.2.1, 2.2.0.1, 2.2 (conflict: hakyll => mtl>=1 && <2.2)
rejecting: mtl-2.1.3.1, 2.1.2 (conflict: transformers==0.4.1.0, mtl =>
transformers==0.3.*)
rejecting: mtl-2.1.1, 2.1 (conflict: base==4.6.0.1/installed-8aa..., mtl =>
base<4.6)
rejecting: mtl-2.0.1.1 (conflict: transformers==0.4.1.0, mtl =>
transformers==0.2.*)
rejecting: mtl-2.0.1.0, 2.0.0.0 (conflict: base==4.6.0.1/installed-8aa..., mtl
=> base<4.6)
rejecting: mtl-1.1.1.1, 1.1.1.0, 1.1.0.2, 1.1.0.1, 1.1.0.0, 1.0 (conflict:
exceptions => mtl>=2.0 && <2.3)
Backjump limit reached (change with --max-backjumps).
[31;1mThe command "cabal install hakyll pandoc" failed and exited with 1 during .[0m
Your build has been stopped.
If there's any other output that would be useful, let me know and I can provide it.
The first thing to try if you get Backjump limit reached from cabal-install is to try again with the option --max-backjumps=-1 which means "search exhaustively", though if it then ends up taking tens of minutes you'd need to interrupt it or rely on the Travis-CI timeout. You can also use 500 or 1000 rather than -1 for a large but limited search - the default is 200.
If that doesn't work then try to pick out specific projects to constrain to a specific version with the option --constraint 'foo==0.1.0.0, preferably one that you actually know should be installable with the same GHC version.
In this particular case, the following two lines suggest that hakyll itself was at the root of the problem:
rejecting: mtl-2.2.1, 2.2.0.1, 2.2 (conflict: hakyll => mtl>=1 && <2.2)
rejecting: mtl-2.1.1, 2.1 (conflict: base==4.6.0.1/installed..., mtl => base<4.6)
In other words, base, which is tied to the GHC version, seems to require mtl>=2.2 (or perhaps less than 2.1 but I suspect that wouldn't have worked either). hakyll was requiring mtl<2.2, so there seemed to be a fundamental conflict implying that this version of hakyll wouldn't work this version of base.
I'm trying to follow the following Yesod tutorial http://yannesposito.com/Scratch/en/blog/Yesod-tutorial-for-newbies/, but I'm getting the following error when trying to do cabal-dev install
cabal-dev install -v
/usr/bin/cabal --numeric-version
/usr/local/bin/ghc-pkg --version
Using ghc-pkg 7.6.3
/usr/bin/cabal --version
/usr/bin/cabal --config-file=/home/pedro/HaskellPlaying/TestApi/MyApiTest/cabal-dev/cabal.config install --verbose=2
Reading available packages...
Choosing modular solver.
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: MyApiTest-0.0.0 (user goal)
trying: fast-logger-2.0.0/installed-a9d... (dependency of MyApiTest-0.0.0)
next goal: warp (dependency of MyApiTest-0.0.0)
rejecting: warp-2.0.1, 2.0.0.1, 2.0.0 (conflict: MyApiTest => warp>=1.3 &&
<1.4)
trying: warp-1.3.10.1
next goal: wai (dependency of warp-1.3.10.1)
rejecting: wai-2.0.0 (conflict: warp => wai>=1.3 && <1.5)
trying: wai-1.4.1
next goal: wai-extra (dependency of MyApiTest-0.0.0)
rejecting: wai-extra-2.0.0.1, 2.0.0 (conflict: MyApiTest => wai-extra>=1.3 &&
<1.4)
rejecting: wai-extra-1.3.4.6, 1.3.4.5, 1.3.4.4, 1.3.4.3, 1.3.4.2, 1.3.4.1,
1.3.4, 1.3.3.2, 1.3.3.1, 1.3.3, 1.3.2.4 (conflict:
fast-logger==2.0.0/installed-a9d..., wai-extra => fast-logger>=0.2 && <0.4)
rejecting: wai-extra-1.3.2.3, 1.3.2.2, 1.3.2.1, 1.3.2, 1.3.1.1, 1.3.1,
1.3.0.5, 1.3.0.4, 1.3.0.3, 1.3.0.2, 1.3.0.1, 1.3.0 (conflict: wai==1.4.1,
wai-extra => wai>=1.3 && <1.4)
rejecting: wai-extra-1.2.0.6, 1.2.0.5, 1.2.0.4, 1.2.0.3, 1.2.0.2, 1.2.0.1,
1.2.0, 1.1.0.1, 1.1.0, 1.0.0.1, 1.0.0, 0.4.6, 0.4.5.2, 0.4.5.1, 0.4.5, 0.4.4,
0.4.3, 0.4.2, 0.4.1.2, 0.4.1.1, 0.4.0.3, 0.4.0.2, 0.4.0.1, 0.4.0, 0.3.3,
0.3.2.1, 0.3.2, 0.3.1, 0.3.0, 0.2.4.2, 0.2.4.1, 0.2.4, 0.2.3, 0.2.2.2,
0.2.2.1, 0.2.2, 0.2.1, 0.2.0, 0.1.3.1, 0.1.3, 0.1.2.1, 0.1.2, 0.1.1, 0.1.0,
0.0.0.2, 0.0.0.1, 0.0.0 (conflict: MyApiTest => wai-extra>=1.3 && <1.4)
I'm new cabal so I don't really understand the problem, though it seems like the issue is that someone wants wai-extra to be one version while something else wants it to be something else.
Could someone tell me what the issue is and how to fix it? Thanks.
It looks to me like you have a mismatch between the version of the scaffolded site and the version of Yesod you have installed. If you run yesod version, you can see which version of the scaffolded site you have generated.
Your best bet is to install the newest version of both the yesod-bin package and the yesod-platform package. You can find instructions for this on the Yesod quick start page, but it's essentially the command:
cabal install yesod-bin yesod-platform
Then try generating a new scaffolding, and you should hopefully be good-to-go.