yesod devel does not work anymore after upgrading to GHC 7.10.2 - haskell

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.

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.

How to downgrade cabal version in Haskell platform?

I've installed the Haskell platform which came with the 7.10.2 version of ghc and the 1.22.6.0 version of cabal. My favorite editor is Atom, so I've installed the ide-haskell and haskell-ghc-mod. Since the ghc-mod has some problems with cabal>=1.22, I need to downgrade cabal. Haskel platform came with an activate-hs script to switch versions but I didn't understand how it works.
The ./activate-hs script only switches between different already installed platform versions. So if you don't have a prior version of the platform installed it won't help. More generally, you should not probably not downgrade cabal versions, as often compilers are coupled to particular releases of cabal.
But if you did want to, the correct way would just be to create a sandbox and then run cabal-install cabal-install-1.20.2.0 or the like. You can then take the resultant binary and move it into your path directly.

Why is "cabal update" so slow and could I do it manually?

When running cabal update, it takes so long time to download 00-index.tar.gz from hackage, howver, when I download it from chrome, it is just a 9M file and the downloading finishes soon.
so, why is cabal update so slow, and could I improve the performance by, for example manually download the files?
as for the version of cabal I am using, it is:
cabal-install version 1.22.6.0 using version 1.22.4.0 of the Cabal
library
As a comment points out -- there was a bug in old versions of cabal-install that slowed things down considerably. Furthermore, modern versions try to not use the native HTTP library, but instead use external curl or wget binaries which are very efficient and more full-featured in terms of support for proxies, etc.

Haskell Eclipse Linux and Buildwrapper

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.

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.

Resources