升级Haskell Stack使用的GHC版本

5

我正在尝试将Haskell Stack安装的GHC版本从8.0.2更新到8.2.1,但似乎我缺少了一些东西。

[user@localhost ~]$ stack --resolver ghc-8.2.1 setup
stack will use a sandboxed GHC it installed
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec

[user@localhost ~]$ stack ghci
Configuring GHCi with the following packages: 
GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /tmp/ghci7878/ghci-script
Prelude> :q
Leaving GHCi.

我认为在更新stack的ghc版本之后需要进行一些额外的步骤,但我不确定。


可能是 https://dev59.com/41cO5IYBdhLWcg3woC9T 的重复问题。 - Alec
1个回答

2

有两个选项。

临时解决方案是每次加载堆栈时都要提供ghc的版本。

ghc --resolver ghc-8.2.1 ghci

如果您没有指定ghc的版本,stack将加载默认版本。

第二个选项是将ghc版本永久配置为stack的默认版本。以下是用于此操作的步骤:

configure *resolver: ghc-8.2.1* in the file *.stack/global-project/stack.yaml*

并重新启动您的堆栈。


谢谢。我知道这个解决方案。我想了解是否可以使用配置命令实现。 - user1657666

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接