Pandoc update fails due to unresolved dependencies - haskell

I am trying to update pandoc on ubuntu 14.04 but it is failing due to unresolved dependencies:
leonardo#ICI-LAS:~$ sudo cabal update
Downloading the latest package list from hackage.haskell.org
ICI-LAS:~$ sudo cabal install pandoc pandoc-citeproc
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: pandoc-1.15.2.1
trying: pandoc-1.15.2.1:-old-locale
trying: pandoc-1.15.2.1:+network-uri
trying: network-2.6.0.2/installed-f92...
rejecting: unix-2.6.0.1/installed-808... (conflict: unix =>
time==1.4.0.1/installed-11d..., pandoc-1.15.2.1:old-locale => time>=1.5 &&
<1.6)
rejecting: unix-2.7.1.0, 2.7.0.1, 2.7.0.0, 2.6.0.1, 2.6.0.0, 2.5.1.1, 2.5.1.0,
2.5.0.0, 2.4.2.0, 2.4.1.0, 2.4.0.2, 2.4.0.1, 2.4.0.0, 2.3.2.0, 2.3.1.0,
2.3.0.0, 2.2.0.0, 2.0 (conflict: network => unix==2.6.0.1/installed-808...)
ICI-LAS:~$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
ICI-LAS:~$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
How can I resolve this problem?

Related

cabal build fails with (conflict: requires GHC2021) it's unclear what this is?

cabal build myproject
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: plutarch (user goal)
[__0] rejecting: plutarch-1.3.0 (conflict: requires GHC2021)
[__0] fail (backjumping, conflict set: plutarch)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: plutarch
I'm running into the above error (conflict: requires GHC2021) however it is not clear what this is? It does not seem to be a package? There is various mentions of GHC2021 in a web search but I still don't understand what this conflict is?
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html seems to indicate it is a language spec, but I'm not sure where this should perhaps be specified?
More info:
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.0.2
$ cabal --version
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library
cabal.project:
packages: myproject/
source-repository-package
type: git
location: https://github.com/Plutonomicon/plutarch-plutus.git
tag: 01a67f56b2bf428538e92ed9ada0ce88d90ab636
Fixed when updating GHC to 9.4.3 and cabal to 3.6.2.

Why can't I cabal install template-haskell-2.17.0.0?

I am trying to install the specific version template-haskell-2.17.0.0. I run this command, but get an error during dependency resolution:
❯ cabal install template-haskell-2.17.0.0 --lib
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: template-haskell (user goal)
[__0] rejecting: template-haskell-2.18.0.0 (constraint from user target
requires ==2.17.0.0)
[__0] rejecting: template-haskell-2.17.0.0 (constraint from user target
requires ==2.16.0.0)
[__0] rejecting: template-haskell-2.16.0.0/installed-2.16.0.0,
template-haskell-2.16.0.0, template-haskell-2.15.0.0,
template-haskell-2.14.0.0, template-haskell-2.13.0.0,
template-haskell-2.12.0.0, template-haskell-2.11.1.0,
template-haskell-2.11.0.0, template-haskell-2.10.0.0,
template-haskell-2.9.0.0, template-haskell-2.8.0.0, template-haskell-2.7.0.0,
template-haskell-2.6.0.0, template-haskell-2.5.0.0, template-haskell-2.4.0.1,
template-haskell-2.4.0.0, template-haskell-2.3.0.1, template-haskell-2.3.0.0,
template-haskell-2.2.0.0 (constraint from user target requires ==2.17.0.0)
[__0] fail (backjumping, conflict set: template-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: template-haskell
I'm using the latest cabal version:
❯ cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.3.0 of the Cabal library
Some packages come with GHC and cannot be reinstalled. These are known as "boot" packages. The template-haskell package is one of these boot packages. You can find a complete list of them here: https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history.
For your particular case, template-haskell-2.17.0.0 is part of GHC 9.0.2 (or 9.0.1). The only way to install that version of template-haskell is to use the appropriate version of GHC.
Based on the error output, I'm guessing that you're using some version of GHC 8.10.x, probably 8.10.7. You don't mention how you installed GHC, so I don't know exactly how to tell you to upgrade. If you used GHCup, then you should be able to upgrade GHC with this command:
ghcup install ghc 9.0.2 --set

yesod with stackage is failing to install due to dependency problems

I tried to set up a yesod project as follows:
mkdir sample_blog
curl -o cabal.config www.stackage.org/nightly/cabal.config
cabal install alex happy yesod-bin
However, I got the following error:
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: Cabal (user goal)
rejecting: Cabal-1.18.1.4/installed-d6c... (global constraint requires
==1.18.1.3)
trying: Cabal-1.18.1.3/installed-476...
trying: yesod-bin-1.4.2 (user goal)
next goal: ghc (dependency of yesod-bin-1.4.2)
rejecting: ghc-7.8.3/installed-1d5... (conflict:
Cabal==1.18.1.3/installed-476..., ghc => Cabal==1.18.1.4/installed-d6c...)
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.
I've install GHC and cabal-install using homebrew.
Versions:
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.3
$ cabal --version
cabal-install version 1.20.0.4
using version 1.20.0.3 of the Cabal library
It appears that homebrew has patched the standard GHC installation, as it's shipping with a different version of the Cabal library than the official GHC. I don't know why that is occurring. A quick workaround would be to remove the Cabal line from your cabal.config. Can you open up an issue against Stackage about this? I'd like to get to the bottom of why this is occurring.

Error resolving cabal dependencies on Travis-CI

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.

Install Cabal-dev on windows 7

I'm trying to install Cabal-dev on windows 7.
I've managed to get past the problem with not being able to build network by using this:
cabal install --constraint="network installed" cabal-dev
However then I get this:
>cabal install --constraint="network installed" cabal-dev
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: cabal-dev-0.9.1
trying: cabal-dev-0.9.1:-no-cabal-dev
trying: network-2.3.1.0/installed-489...
rejecting: parsec-3.1.3/installed-62e... (conflict: network =>
parsec==3.1.3/installed-c65...)
rejecting: parsec-3.1.3/installed-c65... (conflict: parsec =>
mtl==2.1.2/installed-533..., cabal-dev-0.9.1:no-cabal-dev => mtl>=1.1 && <2.1)
rejecting: parsec-3.1.3, 3.1.2, 3.1.1, 3.1.0, 3.0.1, 3.0.0, 2.1.0.1, 2.1.0.0,
2.0 (conflict: network => parsec==3.1.3/installed-c65...)
Mikhail Glushenkov's recommendation worked
I cloned the git repo for cabal-dev and then build it like this:
runhaskell -isrc admin/bootstrap.hs
then I added
{windowspath ..}\cabal-dev\cabal-dev\bin
to my path and everything is working.
I can now run cabal-dev install in my yesod folder get yesod working finally.

Resources