3

Every time I install a library, cabal tells me to install a new version of cabal-install. Despite the fact that i run (with apparent success) the procedure that list below, the version of cabal-install remains unchanged. Where I am going wrong? (My OS is Window 7 64-bits)

My User PATH is C:\Users\Alberto\AppData\Roaming\cabal\bin

System variables: CABAL_DIR = C:\Users\Alberto\AppData\Roaming\cabal

BEFORE the update

C:\Users\Alberto>cabal -V
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library

C:\Users\Alberto>cabal update
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install

C:\Users\Alberto>cabal install cabal-install

AFTER the update

Linking dist\build\cabal\cabal.exe ...
Installing executable(s) in C:\Users\Alberto\AppData\Roaming\cabal\bin
Installed cabal-install-1.18.0.2

C:\Users\Alberto>cabal -V
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library

But:

C:\Users\Alberto>C:\Users\Alberto\AppData\Roaming\cabal\bin\cabal.exe -V
cabal-install version 1.18.0.2
using version 1.18.1.2 of the Cabal library

I am very confused about.

Alberto Capitani
  • 1,039
  • 13
  • 30

3 Answers3

4

What's the output of C:\Users\Alberto\AppData\Roaming\cabal\bin\cabal.exe -V?

MigMit
  • 1,698
  • 12
  • 14
  • C:\Users\Alberto\AppData\Roaming\cabal\bin\cabal.exe -V cabal-install version 1.18.0.2 using version 1.18.1.2 of the Cabal library – Alberto Capitani Jan 27 '14 at 08:58
  • OK, that just means that the cabal.exe file selected by default is not the right one, that's all. Check `echo %PATH%` (I know, you said there is just one directory there, but, unless you checked with `echo`, the real PATH variable could be different). Also check if you have `cabal.exe` file in your current directory. – MigMit Jan 27 '14 at 09:16
  • Solved it for me too. Hat two paths: C:\Program Files\Haskell Platform\2014.2.0.0\lib\extralibs\bin and the AppData\Roaming... path. – Spenhouet Oct 02 '14 at 21:11
3

You probably just need to set your PATH to make sure that C:\Users\Alberto\AppData\Roaming\cabal\bin is at/near the beginning.

You can set this in "Control Panel" -> "System" -> "Advanced System Settings" -> "Advanced" -> "Environment Variables" and then edit the "User variables".

Ganesh Sittampalam
  • 28,821
  • 4
  • 79
  • 98
1

What is your $PATH? It seems that you are using a cabal binary from somewhere else than C:\Users\Alberto\AppData\Roaming\cabal\bin, so that one continues to be used when you type cabal.

Joachim Breitner
  • 25,395
  • 6
  • 78
  • 139