Haskell Stack doesn't use system Ghc

旧时模样 提交于 2020-03-18 12:32:08

问题


I'm trying to use Haskell Stack to setup a project but using the stack provided ghc I am having a -fPIC error GitHub issue

To bypass the fPIC problem I'm trying to use a package manager provided GHC using the 7.10.3 version (stack currently is using 8.0.2)

When I try to force stack to use the systm ghc it simply ignores me. I've tried to override using /home/user/.stack/config.yaml and {project}/stack.yaml system-ghc : true option... but stack use the 8.0.2 version in the setup.

Am I missing something?

TL;DR

Stack ignore the system-ghc : true option

I'm runnig Sabayon 16


"haskell-primer" is the project name

stack list-dependencies

base 4.9.1.0
ghc-prim 0.5.0.0
haskell-primer 0.1.0.0
integer-gmp 1.0.0.1
rts 1.0

回答1:


Setting system-ghc: true allows Stack to use the system GHC if it matches the resolver's constraints. It will not force Stack to use the system GHC if it does not match the constraints. If your resolver requires GHC 8 but your system has GHC 7 then Stack will not use your system GHC no matter what value you give system-ghc. Conversely, if system-ghc: false then Stack will never use the system GHC, regardless of whether its version matches.

From the Stack FAQ, emphasis mine:

If you would like stack to use your system GHC installation, use the --system-ghc flag or run stack config set system-ghc --global true to make stack check your PATH for a suitable GHC by default.

Note that stack can only use a system GHC installation if its version is compatible with the configuration of the current project, particularly the resolver setting.



来源:https://stackoverflow.com/questions/44460120/haskell-stack-doesnt-use-system-ghc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!