
On 2014年05月27日 19:03, Yitzchak Gale wrote:
Travis Cardwell wrote:
I wrote an article explaining how I install multiple versions and avoid ~/.cabal hell (on Debian Wheezy):
Thanks for this detailed write up!
Thank you very much for the feedback!
1. When you switch to a different version of GHC using the PATH, you also need to take into account the cabal command. Normally you will want to be using the most recent cabal command, but your procedure will switch you over to whatever version of the cabal command was shipped with that version of GHC, because that GHC bin directory now comes first in the PATH.
By always installing the latest version of cabal-install globally, the most recent cabal command is in the GHC bin directory. There is no need to prepend another path onto PATH just for cabal. Since cabal is an integral part of the GHC toolchain, I prefer this over having a separate path just for cabal, making PATH (IMHO unnecessarily) longer. (Would there ever be a case where GHC/bin is needed while cabal/bin is not?)
2. You don't need to have cabal-install installed globally. All you need is the executable.
I have been wondering about this, but I install --global cabal-install because I was not sure that the corresponding cabal [library] version might not be expected in some case. As there are no other dependencies, I did not worry about it. I just did a quick test and found that the cabal [library] is not installed with Haskell Platform; just the cabal-install executable is, as you suggest. Thank you for pointing that out to me! I will update the article soon. Cheers, Travis