haskell-platform
haskell-platform copied to clipboard
Cannot update cabal (Windows PATH issue)
On Windows with Haskell Platform 2010.1.0.0 :
- The all-users PATH variable contains %INSTALLDIR%\lib\extralibs\bin.
- The user-specific PATH variable contains %APPDATA%\cabal\bin.
This causes a problem because :
- Every directory in the all-users PATH variable is always checked first, so the shell always uses %INSTALLDIR%\lib\extralibs\bin\cabal.exe.
- cabal install cabal-install only updates %APPDATA%\cabal\bin\cabal.exe rather than both.
- So, you effectively can't update cabal on Windows.
Workaround: Delete %INSTALLDIR%\lib\extralibs\bin\cabal.exe.
I'm not really sure what is the right way to fix this. Adding ~/cabal/bin to all-users PATH is wrong, and adding %INSTALLDIR%/bin only to the current user's PATH will break things for other users. Perhaps we should recommend doing cabal install --global when replacing executables that come with the platform?