本文介绍了使用多个GHC版本的cabal的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的桌面上同时安装了ghc6和ghc7。为了安装新的软件包(针对特定的ghc版本),我使用 cabal 标志 - with-compiler =< ghc-dir> 来指定我希望安装哪个软件包。



我做了 cabal update 之前安装任何新的软件包。但是,如何指定我希望更新哪个ghc?我的意思是,没有 - with-compiler 标志与 cabal install 一样。我认为就像我为ghc7使用 ghc-pkg7 一样,会有 cabal7 。除了 cabal install 命令,我知道它正在应用哪个ghc版本,我不知道哪个ghc受到其他cabal命令的影响。



另外,当我执行 ghc-pkg check 时,发现某些软件包有问题,我不知道如何解决。



在同一台机器上使用多个ghc版本时,我真的很想知道 - 如果有人拥有这些 - 很好的做法。例如如何进行安装,更新等等。 可以创建两个配置文件,比如〜 /.cabal/config 〜/ .cabal / config7 ,并使用un(der)记录的选项 - config-file 在两者之间进行选择。


I got both ghc6 and ghc7 on my desktop. To install new packages (for the specific ghc version), I use cabal with the flag --with-compiler=<ghc-dir> to specify for which ghc i want the package installed.

I do cabal update before installing any new package. But how to I specify for which ghc I want the update? I mean, there is no --with-compiler flag as with cabal install. I would think that just like I use ghc-pkg7 for ghc7, there would be cabal7. Apart from the cabal install command which I know to which ghc version it is applying, I don't know which ghc is affected with the other cabal commands.

Also, when I do ghc-pkg check I find problems with some packages and I don't know how to fix.

I would really like to know - if anyone does have - good practices when using multiple ghc versions on the same machine. e.g. how to proceed with installation, updates, etc.

解决方案

You can create two configuration files, say ~/.cabal/config and ~/.cabal/config7, and use the un(der)documented option --config-file to select between the two.

这篇关于使用多个GHC版本的cabal的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 16:42