gpt4 book ai didi

haskell - Stack 只找到较新版本的 Cabal

转载 作者:行者123 更新时间:2023-12-02 18:39:55 25 4
gpt4 key购买 nike

我正在尝试使用 Stackage lts-13.12 构建我的项目。

在 Stack 提示 Cabal 版本太新后,我尝试安装旧版本:

cabal --version
cabal-install version 2.2.0.0
compiled using version 2.2.0.1 of the Cabal library

但是,当我运行堆栈求解器时,出现以下错误:

Using configuration file: stack.yaml
Using cabal packages:
- ./

Using resolver: lts-13.12

Warning: Installed version of cabal-install (2.4.1.0) is newer than stack has been tested with. If you run into difficulties, consider downgrading.

Using compiler: ghc-8.6.4
Asking cabal to calculate a build plan...
Trying with packages from lts-13.12 and 1 external packages as hard constraints...
The following lines from cabal-install output could not be parsed:
optparse-applicative-0.14.3.0 (via: project-0.1.0.0 project-0.1.0.0) (new
package)
CallStack (from HasCallStack):
error, called at src/Stack/Solver.hs:174:16 in stack-1.9.3-F7FXKCpM3pk5wCtbL9Utvv:Stack.Solver

我的问题是:

  • 为什么 Stack 会看到更新的 Cabal?我怎样才能让它看到旧的?
  • 为什么 Stack 与 Cabal 2.4.1.0 不兼容,而这是 Stackage LTS 13.12 中的版本?

我正在运行 Stack 的版本 1.9.3(如果这有影响的话)。

最佳答案

众所周知,堆栈解算器错误消息很糟糕,并且会阻碍 cabal 的输出。我不认为这个功能维护得很好。

我确实希望 stack 能够更新其错误和警告。坚持使用 cabal-install-2.4.1.0 可能是最好的选择。

我建议您强制它使用 lts-13.12,而不是使用堆栈求解器,然后手动添加额外的 deps 来解决您遇到的任何问题。大多数情况下,堆栈将有助于推荐正确的额外部门(不使用求解器),但您确实需要运用一些直觉来确保它们是正确的。

关于haskell - Stack 只找到较新版本的 Cabal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55111027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com