haskell-platform icon indicating copy to clipboard operation
haskell-platform copied to clipboard

Cannot update cabal (Windows PATH issue)

Open r0ml opened this issue 10 years ago • 1 comments

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.

r0ml avatar Mar 20 '14 20:03 r0ml

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?

r0ml avatar Mar 20 '14 20:03 r0ml