2015-12-26 81 views
2

是否可以使用stack和已安裝的ghc而不使用stack安裝本地副本ghccabalHaskell stack with global ghc

+2

這是包括在[堆棧FAQ](HTTP://文檔。 haskellstack.org/en/stable/faq.html#i-already-have-ghc-installed-can-i-still-use-stack)。 –

回答

2

是的。如果PATH中的ghc對於所選快照的版本是正確的,則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檢查--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 
... 

但可能是一個壞想法