Reinstalling haskell/cabal/haste on ubuntu.
Every now and then I suspect that my haskell configuration has fallen into some bad state that is causing me problems. When this happens, I like to uninstall all haskell related software, delete all my personal haskell configuration, and start over.
What follows is a summary of how I go about doing that uninstall/delete/reinstall process. If you don’t care about haste, disregard that part. Everything up to there is haste-indepedent.
This is just “what works for me”. I don’t claim that what follows is efficient, complete, or even necessary. I do, however, find it to be an occasionally useful part of my own work flow.
FIRST, START FROM SCRATCH
- Clean out existing installations of ghc, cabal, haste :
rm -rf ~/.ghc ~/.cabal ~/.haste
sudo apt-get remove haskell-platform
sudo apt-get remove cabal-install
sudo apt-get remove ghc
sudo apt-get autoremove
- (get rid of any other ghc/cabal installations you may have too)
( should report nothing )
( should report nothing )
- reboot to make a clean start
- Install platform using apt-get
sudo apt-get update
sudo apt-get install haskell-platform
STEP UP TO A NEWER CABAL
- Install a usable version of cabal. I use 184.108.40.206 because it is the latest that works well with the haskell-related vim extensions that I use (ghc-mod, hdevtools, hlint). More details here.
git clone git://github.com/haskell/cabal.git
git checkout tags/Cabal-v220.127.116.11
cabal install Cabal/ cabal-install/
- Now make sure PATH environment variable includes ~/.cabal/bin
- Start a new shell.
- Verify that the correct version of cabal is running.
(should report $HOME/.cabal/bin/cabal )
Should report as follows:
cabal-install version 18.104.22.168
using version 22.214.171.124 of the Cabal library
(I don’t know why install version differs from library version)
At this point you should be able to use haskell (ghc) and cabal. The cabal version you have installed includes the “cabal sandbox” feature.
This introduction to cabal sandboxes is my original reference for this cabal-related information.
- get haste:
git clone https://github.com/valderman/haste-compiler.git
- Install a stable version of haste.
git checkout tags/0.4.4.3
At this point you should be able to use haste (hastec) in addition to haskell and cabal. Note that haste does not work well with cabal sandboxes.
This page from the haste documentation is my original reference for this haste-related information.
VERIFY THAT HASTE WORKS
Haste comes with a test suite that you should now be able to run. From within the haste-compiler directory execute “./runtest.sh” . When I do this, I get 58 out of 59 tests passing and 1 failure.