Why can I not install haskell Slides package? - haskell

Attempting to install Haskell's Slides package, I run into cabal hell:
$ cabal update && cabal install slides
Downloading the latest package list from hackage.haskell.org
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: Slides-0.1.0.8 (user goal)
next goal: base (dependency of Slides-0.1.0.8)
rejecting: base-4.9.0.0/installed-4.9... (conflict: Slides => base>=4.8 &&
<4.9)
rejecting: 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)
Dependency tree exhaustively searched.
I reset my packages by running:
$ rm -rf ~/.ghc ~/.cabal
per the instructions here, but still get that same error. Not sure what to try next.

Slides library 0.1.0.8 (https://hackage.haskell.org/package/Slides) has not been updated to work with GHC versions > 7.10. This is apparent from the base restriction base < 4.9 since GHC 8 uses base 4.9.
You can:
File an issue with the maintainer, who should fix this and upload a new version.
cabal unpack slides then cd slides* and edit slides.cabal changing < 4.9 to < 4.10 then cabal install. That is usually all that is required, but not always so you might see a new set of compilation errors.

Related

`cabal install vector` fails

$ cabal install vector
Resolving dependencies... Error: cabal: Could not resolve dependencies:
[__0] trying: vector-0.13.0.0 (user goal)
[__1] trying: primitive-0.6.4.0 (dependency of vector)
[__2] next goal: base (dependency of vector)
[__2] rejecting: base-4.16.3.0/installed-4.16.3.0 (conflict: primitive => base>=4.5 && <4.13)
[__2] rejecting: 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)
[__2] fail (backjumping, conflict set: base, primitive, vector) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: base, vector, primitive
$ ghc --version && cabal --version
The Glorious Glasgow Haskell Compilation System, version 8.10.7
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
I'm not sure, but it seems primitive and base are conflict packages?
$ uname -a
Darwin MacBook-Pro-2.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64
-v3 output is pasted here:
https://pastebin.com/sfNWXB8R
$ ghc-pkg list
/usr/local/Cellar/ghc/8.10.7_1/lib/ghc-8.10.7/package.conf.d
Cabal-3.2.1.0
array-0.5.4.0
base-4.14.3.0
binary-0.8.8.0
bytestring-0.10.12.0
containers-0.6.5.1
deepseq-1.4.4.0
directory-1.3.6.0
exceptions-0.10.4
filepath-1.4.2.1
ghc-8.10.7
ghc-boot-8.10.7
ghc-boot-th-8.10.7
ghc-compact-0.1.0.0
ghc-heap-8.10.7
ghc-prim-0.6.1
ghci-8.10.7
haskeline-0.8.2
hpc-0.6.1.0
integer-gmp-1.0.3.0
libiserv-8.10.7
mtl-2.2.2
parsec-3.1.14.0
pretty-1.1.3.6
process-1.6.13.2
rts-1.0.1
stm-2.5.0.1
template-haskell-2.16.0.0
terminfo-0.4.1.4
text-1.2.4.1
time-1.9.3
transformers-0.5.6.2
unix-2.7.2.2
xhtml-3000.2.2.1

Could not resolve dependencies while installing libraries with cabal

Every effort of me trying to install a library using cabal on Window 10 resulted in the same error:
cabal install gtk
cabal.exe: Could not resolve dependencies:
[__0] trying: parconc-examples-0.4.8 (user goal)
[__1] next goal: base (dependency of parconc-examples)
[__1] rejecting: base-4.15.0.0/installed-4.15.0.0 (conflict: parconc-examples
=> base>=4.5 && <4.14)
[__1] skipping: base-4.15.0.0, base-4.14.2.0, base-4.14.1.0, base-4.14.0.0
(has the same characteristics that caused the previous version to fail:
excluded by constraint '>=4.5 && <4.14' from 'parconc-examples')
[__1] rejecting: base-4.13.0.0, base-4.12.0.0, base-4.11.1.0, base-4.11.0.0,
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)
[__1] fail (backjumping, conflict set: base, parconc-examples)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, parconc-examples
It worked perfectly fine on Linux, but I have not found how to resolve the problem on Windows.
Your version of the base library is 4.15.0.0. base is special in the sense that its version is tied to your GHC version, which seems to be GHC 9.0.1.
So, unlike with other libraries, cabal can't simply install a previous version of base when it's required by the build-depends: of some package.
parconc-examples has the following constraint on base: >=4.5 && <4.14. So version 4.15 is not accepted ("constraint from non-upgradeable package requires installed instance").
One thing you could try is to pass the extra option --allow-newer=base, like cabal install --allow-newer=base gtk. This will relax the restriction.
But it isn't a panacea: parconc-examples (or other package required by gtk) might actually fail to build with base == 4.15, because it might use some aspect of base == 4.14 that has changed in a non-backwards compatible way. Preventing such build failures is the purpose of bounds, after all.

Cabal can't install ghc-mod

I'm trying to install ghc-mod to use with Atom-Haskell (the ide-haskell package) in Atom, but for some reason my Cabal doesn't want to.
When I enter the command cabal install ghc-mod, I get the following errors in my terminal:
Resolving dependencies...
cabal.exe: Could not resolve dependencies:
[__0] trying: ghc-mod-5.8.0.0 (user goal)
[__1] trying: syb-0.7.1 (dependency of ghc-mod)
[__2] next goal: base (dependency of ghc-mod)
[__2] rejecting: base-4.14.1.0/installed-4.14.1.0 (conflict: ghc-mod =>
base<4.10 && >=4.6.0.1)
[__2] skipping: 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, base-4.10.1.0, base-4.10.0.0 (has the same characteristics that
caused the previous version to fail: excluded by constraint '<4.10 &&
>=4.6.0.1' from 'ghc-mod')
[__2] rejecting: 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)
[__2] fail (backjumping, conflict set: base, ghc-mod)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, ghc-mod, syb
I installed Cabal as part of the Haskell Platform, so to my understanding, it's a bit unusually configured. I don't have a %HOME%.cabal folder, and I don't know if that could be part of the issue?
I don't know a lot about how Cabal or ghc-mod work, so please let me know if you need any more info!
Thanks for any help!
You probably have a new version of base, (https://wiki.haskell.org/Base_package) where ghc-mod is only compatible with versions >=4.6.0.1 && <4.10 (https://hackage.haskell.org/package/ghc-mod). You'd have to downgrade.

Dependency conflicts of base in Haskell cabal

There comes up with a problem that cabal's base is conflicted with the dependency in .cabal file, it seems that my base version is too high, so is there a way to downgrade my base package version in the cabal sandbox.
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: decafc-0.0.0 (user goal)
[__1] next goal: base (dependency of decafc)
[__1] rejecting: base-4.11.1.0/installed-4.1... (conflict: decafc => base>=4.5
&& <=4.9)
[__1] rejecting: base-4.11.1.0, base-4.11.0.0, 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)
[__1] fail (backjumping, conflict set: base, decafc)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, decafc
Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unrstering the offending packages or
recreating the sandbox.
There is another problem that when using stack, how to add some flags to the alex if running stack build, for example, the cabal instruction is cabal install --alex-options="--ghc --template=\"$TOP/alex\"". So how to let the stack do the same things?
The base dependency indicates that it only works with versions between 4.5 and 4.9. That means the latest GHC you can use this package with is 8.0.1, since base ships with GHC and can't be upgraded. You could bump the dependency yourself, but you would likely have to fix things that don't work anymore due to changes in base, or you could install an older version of GHC.

couldn't install leksah on Ubuntu 16.10 using cabal 1.24.0.2/ghc 8.2.1

I'm trying to install leksah as my development environment using cabal but I ran into errors.
user#home:~$ cabal install leksah
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: leksah-0.15.2.0 (user goal)
next goal: base (dependency of leksah-0.15.2.0)
rejecting: base-4.10.0.0/installed-4.1... (conflict: leksah => base>=4.0.0.0 && <4.9)
rejecting: 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)
Backjump limit reached (currently 2000, change with --max-backjumps or
try to run with --reorder-goals).
other detauls regarding haskell install in my machine are as follows -
user#home:~$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 8.2.1
user#home:~$ cabal --version
cabal-install version 1.24.0.2
compiled using version 1.24.2.0 of the Cabal library
user#home:~$ stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0
Any suggestions to resolve these errors?
Let's get the dependencies straight:
leksah has version 0.15.2, which has been released ~18 months ago. It depends on a base package strictly lower than 4.9 (see also the version bump commit).
ghc has version 8.2.1. According to the release notes, the base package has version 4.10.0.0.
You cannot install another base package - it is intrinsically linked to the ghc version (see this post). Note that the version of the base package for ghc 8.0.1 (release notes) is4.9.0.0.
So either
install a haskell version prior to 8, bringing with it an older base package, or
install leksah from its github source (install instructions), or
work with the other contributors to perhaps release a 0.15.1 (or whatever) just bumping versions (provided it's still working of course).
It looks weird though - there are commits in the last two weeks, however the download page mentions that they are planning a 0.16 version - this was half a year ago.
I'm kind of wondering why there is an upper limit on ghcs minor version - currently the version requirement is set to base >=4.0.0.0 && <4.11. So when a ghc next bumps the base package again, the same problem arises. So leksah is pretty much locked to the ghc release cycle.

Resources