cabal install yesod fails? - haskell

Haskell package dependencies continue to be a problem but I don't know how to get around this one. My environment:
Ubuntu 10.10, new install
apt-get install ghc6 cabal-install
cabal update && cabal install cabal-install
Then:
cabal install yesod
And I get this:
$ cabal install yesod
cabal: Error: some packages failed to install:
persistent-0.3.1.2 failed during the building phase. The exception was:
ExitFailure 1
yesod-0.6.6 depends on persistent-0.3.1.2 which failed to install.
$ cabal install persistent-0.3.1.2
Resolving dependencies...
cabal: cannot configure blaze-builder-0.2.0.2. It requires text ==0.10.*
For the dependency on text ==0.10.* there are these packages: text-0.10.0.0,
text-0.10.0.1 and text-0.10.0.2. However none of them are available.
text-0.10.0.0 was excluded because enumerator-0.4.3.1 requires text ==0.11.*
text-0.10.0.1 was excluded because enumerator-0.4.3.1 requires text ==0.11.*
text-0.10.0.2 was excluded because enumerator-0.4.3.1 requires text ==0.11.*
How do I get yesod installed?

To see more details, add -v (or even -v2 or -v3) and perhaps --dry-run. Also it's useful to see what's currently installed, with ghc-pkg list.
When you upgrade persistent, cabal decides it should also rebuild your existing yesod which depends on it. This triggers a blaze-builder upgrade. blaze-builder requires an older text than enumerator which is also being installed.
http://hackage.haskell.org/package/enumerator claims to support older text versions as well as 0.11. But cabal has been outwitted somehow. The verbose output may tell more, or see if you can help it along with a --constraint or two. Or by first uninstalling some related packages, like yesod. And of course be sure you have done cabal update.

yesod is under heavy development. email michael snoyman (contact info can be found here), he is very responsive to requests

There is a dependency-break. Report this as an error to the author of the package. Consider downloading and installing an older version of enumerator manually, too.

I found some information about a better install process here:
https://github.com/yesodweb/yesod
Look for the section about cabal-src.
I'm in the process of trying it out.
I'll report back, and let people know if it works.

Related

Upgrade dependencies

I have an application in a sandbox. Cabal dependencies have no constraints so cabal install --only-dependencies gives me the latest packages.
After a certain period of time I want to bump my dependencies to the latest versions but before this I want to see which dependencies are actually changed to a newer version.
I can check all of them manually of course. But I'd rather see a nice list of the things that will be upgraded.
I assume that cabal install --upgrade-dependencies --only-dependencies --dry-run is the way to do it. I would expect it to give me the list of all the packages that are at newer version that the one in my sandbox. But it never works! I mean, it just says that all dependencies are up to date when they are clearly not. Am I doing something wrong or missing/misunderstanding something?
If I destroy my sandbox completely, rerun cabal install --only-dependencies and diff the freeze files then I can see which packages got bumped. But this is silly. So how can I get cabal install --upgrade-dependencies --only-dependencies --dry-run to work correctly and print all the packages that are going to be upgraded without blowing the sandbox? Ad if those options do not work in cabal why aren't they just removed to avoid confusion?
Thank you.
You can use cabal list --installed and compare "Default available version" with "Installed versions".
Unfortunately cabal's --simple-output switch does not include that information, so to automate it you will need a smallish script.

Failing to install Haskell uniplate library

I am trying to install Elm and the instructions are to install Haskell and then
sh> cabal update
sh> cabal install cabal-install
sh> cabal install -j Elm elm-repl elm-reactor elm-get
When I do, the cabal-install installation installs text-1.2.0.0 which conflicts with the text-1.1.0.0 which uniplate requires so uniplate and its dependents fail to install. Text-1.1.0.0 is installed and present but is rejected in favour of text-1.2.0.0, even though the target needs text-1.1.0.0.
Is there a way to insist that cabal use text-1.1.0.0?
Is there a way to get text-1.1.0.0 and text-1.2.0.0 to co-exist?
Is there a way to convince uniplate that it can accept text-1.2.0.0?
Or a way to make uniplate (or cabal) believe that version text-1.1.0.0 is actually installed? Would that even work?
When I explicitly try to install version 1.1.0.0 of text, I am told that a reinstall would break other packages. Apparently it is a downgrade and not a co-installation. cabal does not seem to have an option to allow to me install two versions of the same library at the same time.
If I uninstall Haskell and all the libraries and then re-install Elm (without installing cabal-install so I don't get text-1.2.0.0 installed so there is no clash), I get 100 or so lines of
package aeson-0.7.0.4-8f84b14cc682e4c9b009352420076a45 is unusable due to missing or recursive dependencies:
attoparsec-0.10.4.0-ec2d0a330db1f6e3a6a3b79471a403ef hashable-1.2.2.0-45bd22df8c4ead6b3a7fb1d08bb07f7d mtl-2.1.3.1-8bcc0591131896cfc8761a93703d4c61 scientific-0.2.0.2-5e275f5d96527da6dc1f05642692a484 syb-0.4.1-be94ebe67c3607f5df1dfcc1906f5d5c text-1.1.0.0-9bd69e9ace700e05fb08e463086bc383 unordered-containers-0.2.4.0-69836b34d13649bcfacc8fb0c9f53e64 vector-0.10.9.1-c550551354bc7c2b5a1d261f39b2f3f4
package aeson-pretty-0.7.1-5dc26d5a4560afe110e90283479a1251 is unusable due to missing or recursive dependencies:
aeson-0.7.0.4-8f84b14cc682e4c9b009352420076a45
text-1.1.0.0-9bd69e9ace700e05fb08e463086bc383
unordered-containers-0.2.4.0-69836b34d13649bcfacc8fb0c9f53e64
vector-0.10.9.1-c550551354bc7c2b5a1d261f39b2f3f4
package asn1-encoding-0.9.0-94e9066cccf7ead73bee5ae4aa982071 is unusable due to missing or recursive dependencies:
mtl-2.1.3.1-8bcc0591131896cfc8761a93703d4c61
package asn1-parse-0.9.0-af4efc4777a8a0d9d19a626d5e4b08ff is unusable due to missing or recursive dependencies:
asn1-encoding-0.9.0-94e9066cccf7ead73bee5ae4aa982071
mtl-2.1.3.1-8bcc0591131896cfc8761a93703d4c61
text-1.1.0.0-9bd69e9ace700e05fb08e463086bc383
I have no idea at all how in resolve this or where to even try. Has anybody trod this path before and do you have any advice or pointers?
Thank you.
Edit
Installing in a sandbox changes the outcome only by degrees: text-1.1.0.0 does not clash with text-1.1.0.0 but still can not be loaded (despite being installed) and still remains the unsatisfied dependency.
blaze-builder is first to fail with cannot satisfy -package-id text-1.1.0.0-9bd69e9ace700e05fb08e463086bc383 yet the same log earlier stated [_12] trying: text-1.1.0.0/installed-9bd... (dependency of Elm-0.13) without apparent error or complaint.
cabal list shows both text-1.1.0.0 and text-1.2.0.0 as installed.
Installing blaze-builder separately looks the same. Dependency resolution shows
[_56] trying: blaze-builder-0.3.3.4 (user goal)
[_57] next goal: text (dependency of blaze-builder-0.3.3.4)
[_57] trying: text-1.1.0.0/installed-9bd...
[_58] done
All looks good but later, same log has
<command line>: cannot satisfy -package-id text-1.1.0.0-9bd69e9ace700e05fb08e463086bc383
(use -v for more information)
The ghc command line already had the -v flag and trying to re-run the command line copied from the log, with more -vs, gives an error with "can't find a package database at
dist/dist-sandbox-ad0bcd57/package.conf.inplace".
No package.conf.inplace seems to exist.
Further edit
On the Elm install page is a link to a BuildFromSource.hs script that is also supposed to work installing Elm. In the time that it took for that script to run and fail to work, I managed to install leiningen, node, npm, grunt and Clojure. I am now further along the road to getting Clojurescript installed in about 20 minutes than I am in getting Elm installed in nearly a week.
Elm looked really interesting but it is playing way too hard to get.
Thanks again to everyone who tried to help.
* Edit *
I finally got it.
Every executable installed by the installer at http://elm-lang.org/Install.elm caused a segfault.
The "Build from source" option at the same page did not work because the dependencies either stepped all over each other or could not get themselves straight in the first place.
The ghc at http://new-www.haskell.org/downloads/osx needs a later version of Mac OS than I have. (A link to older versions would not have gone astray.)
The solution (and it is obvious in retrospect) was to port install haskell-platform and port install hs-cabal-install and cabal install Elm .... I did have to run one of those installers twice because it could not find hackage.haskell.org (How is that a 'user' error?) but my hello-world.elm now compiles.
Thank you all again.
It looks like some dependency issues with elements you already have installed. You will probably need to install it in a sandbox.
First, update to the latest version of cabal:
$ cabal update
$ cabal install cabal cabal-install
Next, make sure you have the installed version of cabal on your $PATH.
$ which cabal
> /path/to/cabal/bin/cabal
If it says something like /usr/bin/cabal you will need to export cabal to be on your $PATH. For me this is `/home/username/.cabal/bin
$ export PATH=/path/to/cabal/bin/cabal;$PATH
Run which cabal again and ensure it is pointing to that path.
Now that you have the latest version of cabal. Run the following:
$ mkdir elm
$ cd elm
$ cabal sandbox init
This will initialize a sandbox where dependencies are completely independent of your other installs. Within this directory, you should be able to install the elm platform by running:
$ cabal install Elm elm-repl elm-reactor elm-get
These will be installed in a sub-directory called .cabal-sanbox/bin/ For convenience, you will probably want to add this to your $PATH so you can run the executables from any directory.
Hope this helps!

Can cabal find matching versions for given set of packages?

I'm in situation where I cannot install new package without reinstalling others (my distribution comes without sandbox).
Is it possible to determine which version of each package I should use so that there will be no conflicts with new one included?
How can I encode this set to create new cabal sandbox?
cabal install --dry-run --avoid-reinstalls should give you some output that indicates the installation plan for a particular package, or fail if it cannot avoid reinstalls due to dependencies.
However, sandboxes are really quite helpful. Independent of how you bootstrap your cabal installation (tarballs, distribution packages, etc.), you should probably add ~/.cabal/bin early in your path and then cabal install cabal-install. This should only fail if the latest version of cabal doesn't work on your version of ghc / base.

cabal install bnfc missing directory

I'm new to Haskell, trying to write a program for compiler construction class.
I installed the haskell-platform package on my ubuntu 13.10, and then (without messing around with anything after installing haskell platform) tried to run the following command:
$ sudo cabal install bnfc
which results with:
Resolving dependencies...
Configuring BNFC-2.6.0.3...
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 process-1.1.0.2 is broken due to missing package
directory-1.2.0.1-508733a890139bbedb8aa76468431462
Failed to install BNFC-2.6.0.3
cabal: Error: some packages failed to install:
BNFC-2.6.0.3 failed during the configure step. The exception was:
ExitFailure 1
As I try installing package directory it says the package is already installed.
Can anyone help?
I also am using Ubuntu 13.10 with the haskell platform package, and bnfc installs for me.
There are a few things you can check....
Don't use sudo with cabal install (by default cabal installs packages in your own home directory, using sudo might be causing trouble by giving the wrong file ownerships, or perhaps trying to put files in /root, or even overwriting /usr stuff)
Rename ~/.cabal/ and ~/.ghc/, and rebuild them by running "cabal update" (You may need to re-add ~/.cabal/bin/cabal from the moved location after the move). These hold installed packages and their info.... Since you have a new vanilla install, these should basically be empty, although the meta info in them may be corrupt. (if for some reason this makes things worse, you can always restore the original directory.... If it solves the problem, you can delete the original .cabal and .ghc)
You can get more info about why a package isn't installing by doing the following
cabal unpack bnfc #This will download and unpack the source code
cd BNFC-2.6.0.3 #enter the newly created source directory
cabal configure #This checks that all system dependencies are met
cabal build #This builds the package
cabal install #This installs the package in ~/.cabal/
(You may have to iterate to another package if a dependency isn't met)
I think 2. may solve your problem, as the error message you showed implies that the build process is hooked on finding a very specific version of the directory package, rather than the latest one. This happened to me once and cleaning out .cabal solved the problem for me.

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