Haskell Stack不使用系统Ghc [英] Haskell Stack doesn't use system Ghc

查看:109
本文介绍了Haskell Stack不使用系统Ghc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Haskell Stack设置项目,但使用ghc提供的堆栈,我遇到了-fPIC错误 GitHub问题

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

要绕过fPIC问题,我尝试使用7.10.3版本的GHC提供的程序包管理器(当前使用8.0.2堆栈)

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)

当我尝试强制堆栈使用systm ghc时,它只是忽略了我. 我尝试使用/home/user/.stack/config.yaml和{project}/stack.yaml system-ghc覆盖:true选项...但是堆栈在安装程序中使用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.

我想念什么吗?

TL; DR

堆栈忽略system-ghc:true选项

Stack ignore the system-ghc : true option

我是16岁的Sabayon

I'm runnig Sabayon 16

"haskell-primer"是项目名称

"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

推荐答案

设置system-ghc: true 允许堆栈可以使用系统GHC(如果它符合解析程序的约束).如果系统GHC与约束不匹配,则不会 force 堆栈使用系统GHC.如果您的解析器需要GHC 8,但您的系统具有GHC 7,则无论您给system-ghc赋予什么值,Stack都不会使用您的系统GHC.相反,如果system-ghc: false,则Stack将从不使用系统GHC,无论其版本是否匹配.

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:

如果您希望堆栈使用您的系统GHC安装,请使用--system-ghc标志或运行stack config set system-ghc --global true来使堆栈在默认情况下检查您的PATH以查找合适的GHC.

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.

请注意,堆栈只能在其版本与当前项目的配置兼容的情况下使用系统GHC安装,尤其是resolver设置.

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.

这篇关于Haskell Stack不使用系统Ghc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆