Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

haskell - Using cabal with multiple GHC versions

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...