2014 haskell cabal update hangs on mac - haskell

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.

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.

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.

Cygwin - Installing a specific package version using the commandline installer

Using the commandline installer, one can easily install Cygwin with a list of wanted packages like so
setup-x86.exe -q -p='tar,sed,<more packages>'
Is it also possible to fix the version of the packages, something like
setup-x86.exe -q -p='tar:1.2.3,sed,<more packages>'
(this obviously doesn't work)?
The short answer to your query is, No. Cygwin's setup -x86.exe does not give you the flexibility to specify version names along with package names. As per the official doc :
The basic reason for not having a more full-featured package manager is that such a program would need full access to all of Cygwin's POSIX functionality. That is, however, difficult to provide in a Cygwin-free environment, such as exists on first installation. Additionally, Windows does not easily allow overwriting of in-use executables so installing a new version of the Cygwin DLL while a package manager is using the DLL is problematic
There are however a couple of workarounds if you want to download a specific package:
Locate a cygwin mirror that hosts the specific version. Google for your version, and if you find a mirror hosting that version, simply use that mirror before running setup -x86.exe. [source]
Maintain a local pacakge repository and use the commandline options -q -L -l x:\cygwin-local\, where your downloaded package tree is in x:\cygwin-local\ [source] . You can learn how to build and maitain packages here
Compile and install the package after you've set up cygwin using make.
This is function that Cygwin's installer now provides. By default, when running from the command line, it will install the latest version of each package, but you can specify a version with =. For example:
setup-x86_64.exe -P git=2.35.0-1,vim
will install the latest version of Vim, and version 2.35.0-1 of Git.

how to compile apache,mysql and php in linux

I have never used Linux OS. Want to know how we can start compiling Apache,Mysql and php in Linux and is it necessary to configure it.
I tried doing it by using cd/user/scr/httpd_2.0.09
Do we need to downloads the set up from google
Do yourself a favour and don't try to compile your own webserver etc. ;)
Aside from the fact that it's a lot of work to set up the tools for compiling, resolve dependencies, and debug possible errors, you will have to do the same procedure with every tiny update – instead of simply getting a new version via your package manager.
If you use a common distribution, install the packages required for the so-called LAMP stack, and configure them properly. That will be hard enough for starters.
If you're using Ubuntu, have a look here: https://help.ubuntu.com/community/ApacheMySQLPHP
Actually installing binaries from repositories is less painful than compiling, but if you really want so, you may install Gentoo or other source-based distributive. I've simply described compilation of MySQL 5.5 in my blog.
To compile packages on Debian based systems you need to install build-essential and cmake package (and maybe some other *-dev packages, which appears to be missing during source configure).
For example to compile MySQL 5.5 it is enough to run:
cmake . #yep, with dot. Will prepare your source according to your system
make
make install #will install compiled binaries to system

Can I use a more recent GHC with the current Haskell Platform?

I have the latest Haskell Platform (2012.2.0.0) 64bit OSX. But.. I have run into an issue with the 64bit compiler on Mac, which means that yesod devel crashes as soon as it starts.
I can't swap to the 32 bit version because of completely different issues with getting GTK+ to work.
I see the issue with GHC is fixed in 7.6.1 but the latest HP comes with 7.4. So, can I install GHC 7.6 on top of my working HP installation, or is that going to screw everything up?
Yes just install it in a separate directory and remember to change your path each time you wanna use it with the different versions, or change the name of the simulink in your bin like how mac ports does i.e. for instance in my bin i have ghc , ghc-7.4.1 and ghc-7.4.2 which are all different versions.
so in your case i would create two simulinks in /bin ghc-32 and ghc-64 for each of the two separate versions
Also it is important not to forget to CHANGE YOUR INSTALL PREFIX each build, usually denoted by --prefix when compiling GHC

Resources