Failed to install ssh-0.2.12 (haskell package ) - haskell

I tried to install haskell package ssh-0.2.12 with
sudo cabal install ssh-0.2.12 but it fails with
src/SSH.hs:58:114: Not in scope: type constructor or class `SHA1'
src/SSH.hs:59:115: Not in scope: type constructor or class `MD5'
Failed to install ssh-0.2.12
cabal: Error: some packages failed to install:
ssh-0.2.12 failed during the building phase. The exception was:
I am on Ubuntu 13.04.

This is because ssh just depends on cryptohash without an uppper version bound.
It was probably written against cryptohash 0.9.1, in which the MD5 constructor existed and where it is marked as deprecated, but now cryptohash 0.10.0 is out which doesn't contain it anymore.
Your cabal will install the latest versions of dependencies if there are no restrictions on them.
The right thing to do is to file a bug against the ssh package so that it gets updated. You can find a bugtracker URL on its hackage page.
Note: It is controversial whether upper version bounds are good or bad.

Related

Issue installing Snap on macOS Sierra

I'm having trouble installing the Haskell framework Snap on macOS Sierra. Whenever I install it, I get the following message:
Resolving dependencies...
Configuring securemem-0.1.9...
Configuring skein-1.0.9.4...
Configuring configurator-0.3.0.0...
Configuring cryptonite-0.24...
Building configurator-0.3.0.0...
Building securemem-0.1.9...
Building skein-1.0.9.4...
Failed to install configurator-0.3.0.0
Build log ( /Users/nicholas/.cabal/logs/ghc-8.2.1/configurator-0.3.0.0-6dySPcNCURWFswtMXJvzho.log ):
cabal: Entering directory '/tmp/cabal-tmp-66175/configurator-0.3.0.0'
Configuring configurator-0.3.0.0...
Preprocessing library for configurator-0.3.0.0..
Building library for configurator-0.3.0.0..
<command line>: cannot satisfy -package-id attoparsec-0.13.2.0-5dp4kBDsiGY4dQpLKbD5rk:
attoparsec-0.13.2.0-5dp4kBDsiGY4dQpLKbD5rk is unusable due to shadowed dependencies:
scientific-0.3.5.1-L0qYzdp0wpz8rO8gircNSR text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH
(use -v for more information)
cabal: Leaving directory '/tmp/cabal-tmp-66175/configurator-0.3.0.0'
Configuring transformers-base-0.4.4...
Building cryptonite-0.24...
Building transformers-base-0.4.4...
Installed securemem-0.1.9
Installed transformers-base-0.4.4
Installed skein-1.0.9.4
Installed cryptonite-0.24
Updating documentation index
/Users/nicholas/Library/Haskell/share/doc/x86_64-osx-ghc-8.2.1/index.html
cabal: Error: some packages failed to install:
configurator-0.3.0.0-6dySPcNCURWFswtMXJvzho failed during the building phase.
The exception was:
ExitFailure 1
snap-1.0.0.2-5CZKyA9EY4oLgkpHYCVfnv depends on snap-1.0.0.2 which failed to
install.
I'm using the Haskell Platform installed using homebrew (brew cask install haskell-platform), and cabal version 2.0.0.2. I have tried using sudo and deleting my ~/.ghc file
There was an issue with full 8.2.1 binary platform builds that's just been resolved: https://mail.haskell.org/pipermail/haskell-cafe/2017-October/127979.html
This was likely an instance of that.
(see also: GHC cannot find libraries on fresh install of Haskell-Platform)
This looks like a bug in Cabal 2 (or potentially GHC 8.2). See https://github.com/haskell/cabal/issues/4728. I'd recommend sticking to GHC 8.0.2 for the moment with either cabal 1.24 or Stack. I'm the case of Stack, the version won't matter, since it will use the Cabal version shipped with GHC.

Can't install sdl2 via cabal

I am trying to install helm. When I try to install it, however I get this error:
$ cabal install helm
Resolving dependencies...
Configuring sdl2-1.1.0...
cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could
not be found.
Failed to install sdl2-1.1.0
cabal: Error: some packages failed to install:
helm-0.6.1 depends on sdl2-1.1.0 which failed to install.
sdl2-1.1.0 failed during the configure step. The exception was:
ExitFailure 1
When I go to install sdl2 by itself, I get a similar message.
$ cabal install sdl2
Resolving dependencies...
Configuring sdl2-1.1.0...
cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could
not be found.
Failed to install sdl2-1.1.0
cabal: Error: some packages failed to install:
sdl2-1.1.0 failed during the configure step. The exception was:
ExitFailure 1
I don't understand. According to Hackage, sdl2 is at version 1.1, but installing it requires version 2.0.3? I've tried this in and out of a sandbox. Results of ghc-pkg list are here if you think they're relevant: http://pastebin.com/tFrsfPFe
I'm on Ubuntu btw.
Help?
Another thing which could happen (happened to me) for other installs is that the PKG_CONFIG_PATH variable might not point to the package config file (sdl2.pc, for me in the /usr/local/lib/pkgconfig directory). pkg-config uses some default directories ('/usr/lib/pkgconfig' and '/usr/share/pkgconfig'), but if the sdl.pc file isn't in one of these, you'll have to specify the directory in the environment variable. You can check this with echo $PKG_CONFIG_PATH
If it turns out you need to set the variable, just use export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig (or to whatever directory your sdl2.pc file lives in)
I ran into the same problem, and I just want to add my solution here for the record. The native sdl2 libraries need to be installed first by following the directions here: https://github.com/haskell-game/sdl2#building

cabal error: Could not find module `GHC.TypeLits'. How do I fix this?

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"

yesod install fails

I generally find that cabal install's for more than half of big packages fail, rather a fatal flaw to new users!
This time I am trying to install yesod, any hints?
> cabal install yesod
...
Loading package time-1.2.0.5 ...
GHCi runtime linker: fatal error: I found a duplicate definition for symbol
_get_current_timezone_seconds
whilst processing object file
C:\Users\guthrie\AppData\Roaming\cabal\time-1.2.0.5\ghc-7.4.1\HStime-1.2.0.5.o
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
GHCi cannot safely continue in this situation. Exiting now. Sorry.
cabal: Error: some packages failed to install:
authenticate-1.3.1.1 depends on http-conduit-1.6.1.1 which failed to install.
http-conduit-1.6.1.1 failed during the building phase. The exception was:
ExitFailure 1
yesod-1.1.1.2 depends on yesod-core-1.1.2.1 which failed to install.
yesod-auth-1.1.1.1 depends on yesod-core-1.1.2.1 which failed to install.
yesod-core-1.1.2.1 failed during the building phase. The exception was:
ExitFailure 1
yesod-form-1.1.3 depends on yesod-core-1.1.2.1 which failed to install.
yesod-json-1.1.0 depends on yesod-core-1.1.2.1 which failed to install.
yesod-persistent-1.1.0 depends on yesod-core-1.1.2.1 which failed to install.
yesod uses a different version of alex package than the Haskell platform. I always install alex and happy from my distro's package manager apart from ghc and then use cabal. Alternatively, you can always use
cabal update && cabal install alex happy
cabal install yesod-platform
This most likely occurs due to trying to install with two versions of the time package simultaneously. Can you try running cabal install yesod-platform and see if the problem persists?
And as #Inaimathi said, this might be due to an older version of cabal. Perhaps also try cabal update && cabal install cabal-install.

installing reactive banana-wx or wx on redhat based linux with ghc 7.0.4

hi i'm trying to install, (without having to update or install the latest compiler),reactive-banana-wx and one of the requirement's are failing
cabal install reactive-banana-wx
and heres the error
Configuring wxc-0.90.0.4...
setup: failed
cabal: Error: some packages failed to install:
reactive-banana-wx-0.6.0.1 depends on wxc-0.90.0.4 which failed to install.
wx-0.90.0.1 depends on wxc-0.90.0.4 which failed to install.
wxc-0.90.0.4 failed during the configure step. The exception was:
ExitFailure 1
wxcore-0.90.0.3 depends on wxc-0.90.0.4 which failed to install
when i try to cabal install wxcore ,wx or wxc they all say failed and point towards wxc being required.
here's the error
cabal install wxc
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/wxc-0.90.0.419410/wxc-0.90.0.4/Setup.hs, /tmp/wxc-0.90.0.419410/wxc-0.90.0.4/dist/setup/Main.o )
Linking /tmp/wxc-0.90.0.419410/wxc-0.90.0.4/dist/setup/setup ...
Configuring wxc-0.90.0.4...
setup: failed
cabal: Error: some packages failed to install:
wxc-0.90.0.4 failed during the configure step. The exception was:
ExitFailure 1
here's my compiler info if it would be useful
ghc -v
Glasgow Haskell Compiler, Version 7.0.4, for Haskell 98, stage 2 booted by GHC version 7.0.4
I've got the same error trying to install phooey with ghc 7.4.1 on Debian tonight. The reason is a bug in the package wxc-0.90.0.4 and it should affect all wxHaskell-based packages. You can fix it, there is no need to downgrade your wxc package...
The easiest way to reproduce it is to do
cabal install wxc
or
cabal install glade
It might be a good idea to make sure that all prerequisites are in place, before you do it. wxc depends on a number of cabal and Linux packages and all of them should be installed and compiled... I did it in the most stupid way possible, just by running
cabal install wxc
and reading error messages which it spills out. This sweetie usually tells you what it wants... For instance, if it complains about cabal package x, just do cabal install x. If it complains about Linux package y, then use your Linux package manager and install the development version of this package, which is called normally lib<y>-dev in Debian. So, for instance, if
cabal install wxc
gives you an error saying that package gtk+2.0 is missing, you want to do
apt-get install libgtk2.0-dev
The same story with cairo, glade2 and other GTK-related libraries
When you are green with all prerequisites, you want to install wxWidgets-2.9, which is currently in the Development stage... so, it doesn't have any binaries for Linux and you should build it yourself. Download the source code from wxWidgets website and build it. It is pretty easy to do, just:
untar/unzip the source code to your favorite directory
run ./config
run ./make
If you are on wxc-0.90.0.4, at this moment you should encounter our little bug... To keep the long story short, it is in the file eljpen.cpp, which you can find in
~/.cabal/packages/hackage.haskell.org/wxc/0.90.0.4/wxc-0.90.0.4.tar.gz
Open the archive, go to the line 159 in the file and replace *_ref = NULL; with _ref = NULL or anything else what makes more sense. Then recreate the archive in the same place with the fixed eljpen.cpp file in it.
run ./make
It should work now.
run sudo make install (normally, you should have root privileges to insatll wxWidgets library...).
after it is done try to do
cabal install wx
again. It should be working now. I guess, after that you can enjoy your reactive-banana-wx, wxHaskell, phooey, etc.
PS http://sourceforge.net/tracker/index.php?func=detail&aid=3576397&group_id=73133&atid=536845. Why didn't I find it earlier? :/
I'v solved this problem on Lubuntu 12.10 so:
sudo cabal info wx
Synopsis: wxHaskell
Versions available: 0.11.1.2, 0.12.1.4, 0.12.1.5, 0.12.1.6, 0.13.2,
0.13.2.1, 0.13.2.3, 0.90, 0.90.0.1 (and 11 others)
I picked out different versions of wxHaskell, but only 0.13.2.3 was right.
sudo cabal install wx-0.13.2.3
...and everything has compiled and installed. Then I could install:
sudo cabal install reactive-banana-wx -fbuildExamples
That's no depends on the version of your Glasgow Haskell Compiler or the sort of your Linux.

Resources