Haskell Eclipse Linux and Buildwrapper - linux

I am kind of new Eclipse user, and Haskell too. I keep trying to understand what is wrong and what to do, as my Eclipse after I installed Haskell platform keeps me saying following
Configuring Test1-0.1...
buildwrapper: Left over temporary directory not removed: /tmp/dynamic-cabal.23
<command line>: cannot satisfy -package Cabal-1.22.0.0
I tried it on Ubuntu and Archlinux. Same behaviour. I have also read a lot of forums, and there is kind of information about GHC versions, cabal versions, and buildwrapper versions issues, but I could not figure how to fix that thing...
For example like here https://github.com/JPMoresmau/BuildWrapper/issues/18
I tried cabal install cabal-install Eclipse started to behave a little different, cycling this over and over and over...
configuring because setup_config not present
Resolving dependencies...
Configuring Test1-0.1...
Any help please...

I do not know if it qualify for answer, I hope so.
The problem was that when I install GHC from standard ubuntu and arch repository, it installs Cabal-1.18.1.5 and Cabal-Install-1.22.0.0 system wide. And this causing EclipseFP plugin to install buidwrapper version which was supposed to work with 1.22 Cabal, while I actually had 1.18. Eclipse setting for Haskell said I had Cabal 1.22 (which was wrong).
What I did is added ArchHaskell repository, and installed everything from there, which got me 1.18 combo of Cabal and Cabal-install. EclipseFP worked it OK, finally.
I think there was a way to move local install up in hierarchy so EclipseFP would pick it up. But I understood it may be too late.

Related

How do you get the most recent version of Cabal for Haskell?

I've just spent about an hour going in circles trying to get version 2 of Cabal. Initially I found that the version that came with my LinuxMint install was version 1, so I tried cabal update, didn't do it. So I found instructions which said to use cabal install Cabal cabal-install. Did it, got an error. Found that the error apparently had to do with using the most current version of Haskell. So I installed version 7 to get Cabal. Seemed to work, looked like I finally got Cabal version 2. But I also want the most current version of Haskell so I downloaded the binaries for it and installed that again--now it seems like Cabal is set back to version 1. Is it not possible to have both version 8 of Haskell and version 2 of Cabal?
Along the lines of danidiaz's comments, I suggest directly installing cabal-install in your home directory.
Begin by making sure you are actually using the 8.x version of GHC you want (use which ghc and ghc --version if need be). Also, get rid of any other cabal-install versions you might have installed, so that there is less margin for confusion.
The [directory] ~/.cabal/bin is not in my PATH variable, should I put it in toward the front of its definition?
Exactly. ~/.cabal/bin is the default location for executables locally installed with cabal-install, which includes cabal-install itself, and so it must be in the PATH. Putting it towards the front of the PATH will give it priority over any system-wide installation of cabal-install installed with your package managers. (Note that that won't be an issue if you remove said system-wide installation beforehand.)
Once the terrain is clear, you can download a suitable binary tarball from Cabal's download page, extract the executable and put it in ~/.cabal/bin. As danidiaz notes, the binaries there aren't necessarily at the latest stable version (as I write this, the Linux binaries are 2.2.0.0 rather than 2.4.0.0), but that likely won't matter, as once you have some version of cabal-install available you can simply run...
cabal new-update # For version 2.4 or above; if not, use cabal update instead.
cabal new-install cabal-install
... which will update your cabal-install to the latest stable version.
(Note that I'm using the new-* cabal-install commands. I strongly advise you to do the same.)
Also, looking through the Cabal folder, I don't see binaries. The only folders present are Distribution, Language, tests, and doc.
It sounds like you downloaded the sources of Cabal, the library, rather than the ones of cabal-install, the tool. The cabal-install sources are also available from the download page linked above (as I write this, their version is 2.4.0.0). If you are getting them from GitHub instead, you should look into the cabal-install directory, rather than the Cabal one. Either way, once yo are in the appropriate directory, to install from source run...
./bootstrap.sh --sandbox
... which only requires GHC (as opposed to a pre-existing cabal-install). Once it finishes building cabal-install, the script will tell you the location of the executable (presumably in a .cabal-sandbox/bin subdirectory). Copy the executable to ~/.cabal/bin and proceed as before.

yesod devel does not work anymore after upgrading to GHC 7.10.2

I've upgraded to ghc 7.10.2 this morning. After doing that yesod devel does not seem to recompile the project properly since I cannot see any changes I'm making to the code, even though it seems to recompile some sources. I can only see the changes I've made after doing a cabal install (cabal-version is 1.22.6.0) which takes quite a lot of time.
How can I restore yesod devel to it's former functionality with ghc 7.10.2?
Updating to the latest version of yesod-bin (currently: 1.4.14) fixed the issue for me.

2014 haskell cabal update hangs on mac

I initially installed haskell platform ( 2013 version; 7.6.3 ghc ) on my mac. Everything was working great. Just now saw the haskell platform website again and found new version was released ( Haskell Platform 2014.2.0.0 for Mac OS X, 64bit ). I installed it, and un-installed the older version using uninstall-hs.
Now when i type "cabal" or "cabal update" on my terminal, it hangs. Actually when i look into Activity Monitor, i can see that it is invoking some "sh script & possibly some find command" infinitely. I initially guess may be it is building some indexes. but it has been running for an hr or so.
Please advice. I cannot install any other package using cabal.
As suggested by Zeta, you can remove (or to be safe, backup) ~/.cabal and ~/.ghc first. I also have a Mac OS X 10.9.4 and recently upgraded. I ran the uninstall-hs script, and installed the new Haskell Platform 2014. Even without backing up those directories though, I still had an event free uninstall/update.
Also, ensure to double check your paths in your ~/.bash_profile, as they will need to be updated.
Here is an example of mine, to hopefully give you some clues as what may need to be done.
# Haskell / Cabal
export PATH="$HOME/Library/Haskell/bin:$PATH"
export PATH="$HOME/Library/Haskell/ghc-7.8.3-x86_64/lib/cabal-install-1.20.0.3/bin:$PATH"
export PATH="$HOME/.emacs.d/hslint:$PATH"
export PATH="$HOME/Library/Haskell/ghc-7.8.3-x86_64/lib/cgrep-6.4.4/bin:$PATH"
As for cabal try $ which cabal and cabal -V to verify you are running the latest 1.20 cabal version and that it's set in your $PATH.

What is the "officially" recommended way of installing Haskell from source?

How does one install Haskell from source (on Red Hat) now?
The current page has broken links and conflicting advice.
From http://www.haskell.org/platform/linux.html
Get and install GHC 7.6.3 prior to building the platform
From http://www.haskell.org/ghc/download_ghc_7_6_3
For most users, we recommend installing the Haskell Platform instead of GHC. The current Haskell Platform release includes a recent GHC release as well as some other tools (such as cabal), and a larger set of libraries that are known to work together.
(the link to cabal-install is broken).
The broken link should be pointing to http://www.haskell.org/haskellwiki/Cabal-Install instead. If you want to install from source, you're first going to have to compile and install GHC from source, then you can install the Haskell Platform from its source.
I'm not really sure what conflicting information you're seeing, if you want to build from source you have to install GHC first. Alternatively, you can just install the Haskell Platform from the distributable (might not be possible on Red Hat) and it'll install GHC for you. Both are pretty straightforward.

Error In Haskell Platform 2010.2.0.0 Cabal

I have got an error during command execution "cabal update" on Haskell Platform 2010.2.0.0. Error message is "cabal: Codec.Compression.Zlib: incorrect header check". OS version is Windows XP SP3, Cabal version is 0.8.2. Cabal library version is 1.8.0.2. All are from default package. Any help will be welcomed.
You might find it is the problem in this ticket. We think the problem is with misconfigured HTTP proxies that lie about doing transparent decompression. We think we have a fix, so you could try using the latest darcs version of cabal-install and see if that works for you. Either way, add your experience to the ticket so we can either confirm the fix or work out why it's still not working.
Cabal library 1.10 or later and cabal-install from darcs HEAD already have a fix for this.
As suggested in haskell-cafe (can't provide a link at a moment), you can
Try with upgrade HTTP library or
Try wget http://hackage.haskell.org/packages/archive/00-index.tar.gz and place the tarball to the ~/.cabal/packages/hackage.haskell.org

Resources