gpt4 book ai didi

haskell - 'lens' 的 cabal 依赖性解析失败

转载 作者:行者123 更新时间:2023-12-02 12:23:09 27 4
gpt4 key购买 nike

我刚刚进行了 Cabal 更新并尝试从 hackage 安装“lens”。这给了我以下错误 -

$ cabal install -j lens
Resolving dependencies...
Configuring dlist-0.7.0.1...
... <snip>
Configuring mtl-2.0.1.0...
Building mtl-2.0.1.0...
Failed to install mtl-2.0.1.0
Last 10 lines of the build log ( /home/aj/.cabal/logs/mtl-2.0.1.0.log ):
Building mtl-2.0.1.0...
Preprocessing library mtl-2.0.1.0...
[ 1 of 21] Compiling Control.Monad.Writer.Class (
Control/Monad/Writer/Class.hs, dist/build/Control/Monad/Writer/Class.o )
[ 2 of 21] Compiling Control.Monad.State.Class ( Control/Monad/State/Class.hs,
dist/build/Control/Monad/State/Class.o )
[ 3 of 21] Compiling Control.Monad.Reader.Class (
Control/Monad/Reader/Class.hs, dist/build/Control/Monad/Reader/Class.o )
[ 4 of 21] Compiling Control.Monad.RWS.Class ( Control/Monad/RWS/Class.hs,
dist/build/Control/Monad/RWS/Class.o )
[ 5 of 21] Compiling Control.Monad.Identity ( Control/Monad/Identity.hs,
dist/build/Control/Monad/Identity.o )
[ 6 of 21] Compiling Control.Monad.Error.Class ( Control/Monad/Error/Class.hs,
dist/build/Control/Monad/Error/Class.o )
Control/Monad/Error/Class.hs:93:18: Not in scope: `catch'
... <snip>
cabal: Error: some packages failed to install:
aeson-0.7.0.3 depends on mtl-2.0.1.0 which failed to install.
exceptions-0.6 depends on mtl-2.0.1.0 which failed to install.
free-4.7.1 depends on mtl-2.0.1.0 which failed to install.
lens-4.1.2 depends on mtl-2.0.1.0 which failed to install.
mtl-2.0.1.0 failed during the building phase. The exception was:
ExitFailure 1

看来 mtl-2.0.1.0 已损坏。然而,更多的依赖性跟踪表明,镜头包定义中的任何内容实际上都不依赖于该版本的 mtl。事实上,我尝试的下一件事是 -

$ cabal install -j aeson
$ cabal install -j free
$ cabal install -j lens

并且成功,没有任何问题。

那么为什么 cabal 在直接安装 lens 时会尝试安装 mtl-2.0.1.0 呢?我尝试删除 .ghc 和 .cabal 目录并重复这些步骤,得到相同的结果。我使用的 cabal 版本是 1.16 -

$ cabal -V
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library

最佳答案

我使用的解决方法是首先安装带有 Transformers 3 标志的 Transformers-compat

$ cabal install -ftransformer3 transformers-compat

然后安装带有变形金刚0.3.0.0约束的镜头

$ cabal install --constraint="transformers==0.3.0.0" lens

关于haskell - 'lens' 的 cabal 依赖性解析失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23510242/

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