Haskell堆栈与全球ghc

时间:2015-12-26 09:10:41

标签: haskell ghc cabal haskell-stack

是否可以将stack与已安装的ghc一起使用而不stack安装ghccabal的本地副本?

1 个答案:

答案 0 :(得分:3)

是。如果ghcPATH的所选快照版本正确,stack将很乐意使用它。

% ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4

% stack --resolver=lts-2.22 install packdeps
Run from outside a project, using implicit global project config
Using resolver: lts-2.22 specified on command line
packdeps-0.4.1: unregistering
packdeps-0.4.2: download
...

% stack --resolver=nightly-2015-12-25 install packdeps
Run from outside a project, using implicit global project config
Using resolver: nightly-2015-12-25 specified on command line
Compiler version mismatched, found ghc-7.8.4 (x86_64), but expected minor version match with ghc-7.10.3 (x86_64) (based on resolver setting in /Users/phadej/.stack/global/stack.yaml).
Try running "stack setup" to install the correct GHC into /Users/phadej/.stack/programs/x86_64-osx/

您也可以跳过ghc check --skip-ghc-check

% stack --resolver=nightly-2015-12-25 --skip-ghc-check install packdeps
Run from outside a project, using implicit global project config
Using resolver: nightly-2015-12-25 specified on command line
split-0.2.2: configure
...

但这可能是一个糟糕想法