【问题标题】:Issue while Haskell instaling Euterpea's dependency, HCodecs did not skip version check for a later version installedHaskell 安装 Euterpea 的依赖项时出现问题,HCodecs 没有跳过版本检查以安装更高版本
【发布时间】:2020-11-15 06:46:29
【问题描述】:

当我今天安装 Euterpea 时,我发现 HCodecs-0.5.1(Euterpea 的依赖项)往往总是失败

所以我去了 Hackage.Haskell.org,检查了 HCodecs 提供了最新版本:HCodecs-0.5.2,我通过 cabal v1-install 成功安装了它(严格按照 Euterpea.com 和 Haskell.org 的说明进行操作) )

但是,我安装了HCodecs-0.5.2之后,Euterpea的安装仍然无法安装HCodecs-0.5.1;对于依赖项检查来说,哪个 id 很奇怪并没有跳过旧版本的包,以便在本地获得更高版本的包;

这是2的安装日志,希望有人能帮助我绕过版本检查,或者解决HCodecs-0.5.1的构建失败:

=================安装 HCodecs-0.5.2================ ==========


PS C:\WINDOWS\system32> cabal v1-install HCodecs-0.5.2
Resolving dependencies...
Downloading  fail-4.9.0.0
Downloaded   fail-4.9.0.0
Starting     fail-4.9.0.0
Building     fail-4.9.0.0
Completed    fail-4.9.0.0
Downloading  HCodecs-0.5.2
Downloaded   HCodecs-0.5.2
Starting     HCodecs-0.5.2
Building     HCodecs-0.5.2
Completed    HCodecs-0.5.2

===继续安装 Euterpea,HCodecs-0.5.1 没有跳过,又失败了 ====

PS C:\WINDOWS\system32> cabal v1-install Euterpea
Resolving dependencies...
Starting     HCodecs-0.5.1
Building     HCodecs-0.5.1
Failed to install HCodecs-0.5.1
Build log ( C:\Users\12798\AppData\Roaming\cabal\logs\ghc-8.10.2\HCodecs-0.5.1-KovArVTnpFnLaEvHYYD8GP.log ):
Preprocessing library for HCodecs-0.5.1..
Building library for HCodecs-0.5.1..
[1 of 7] Compiling Codec.ByteString.Builder ( src\Codec\ByteString\Builder.hs, 
dist\build\Codec\ByteString\Builder.o )
src\Codec\ByteString\Builder.hs:79:1: warning: [-Wunused-imports]
    The import of `Data.Semigroup' is redundant
      except perhaps to import instances from `Data.Semigroup'
    To import instances alone, use: import Data.Semigroup()
   |
79 | import Data.Semigroup
   | ^^^^^^^^^^^^^^^^^^^^^
[2 of 7] Compiling Codec.ByteString.Parser ( src\Codec\ByteString\Parser.hs, dist\build\Codec\ByteString\Parser.o )
src\Codec\ByteString\Parser.hs:143:5: error:
    `fail' is not a (visible) method of class `Monad'
    |
143 |     fail  err  = Parser $ \(S _ _ bytes) ->
    |     ^^^^
cabal: Leaving directory 'C:\Users\12798\AppData\Local\Temp\cabal-tmp-13328\HCodecs-0.5.1'
cabal.exe: Error: some packages failed to install:
Euterpea-2.0.7-16Dwojok2ejBacdiDIytTu depends on Euterpea-2.0.7 which failed
to install.
HCodecs-0.5.1-KovArVTnpFnLaEvHYYD8GP failed during the building phase. The
exception was:
ExitFailure 1

这就是我关于依赖版本问题的全部日志

【问题讨论】:

    标签: windows haskell cabal cabal-install euterpea


    【解决方案1】:

    问题在于 Euterpea 完全依赖于 0.5.1 版的 HCodecs,并且仅在 0.5.2 版中添加了对 MonadFail Proposal(从 GHC 8.8.1 开始完全实现)的支持。在 Euterpea 更新其依赖项列表之前,您有两种选择来解决此问题:将 --allow-newer 命令行标志传递给 cabal,这将导致它忽略版本上限,或者将您的 GHC 降级到最终版本 8.6.5没有完全实施 MonadFail 提案。在这种情况下,我推荐前者。

    【讨论】:

    • 感谢您的建议,但我可以在哪里应用 --allow-newer 命令?
    • @KaijCH cabal v1-install --allow-newer Euterpea
    • :谢谢,确实解决了我的问题,Euterpea 安装为“Completed”,但是日志只显示 Euterpea 的安装本身,是否意味着所有其他依赖项都已安装?
    • :是的,重启后所有包现在都可以正常工作了,谢谢你的解决我猜直到 Euterpea 的依赖项修改了它的 Euterpea.cabal 文件,你的 --allow-newer 解决方案是从 cabal 安装的唯一优雅方式
    • 此处为 GCH 8.10.3 和 cabal 3.2.0.0,这是对我的上述解决方案的确认,截至 2021 年 1 月。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-11
    相关资源
    最近更新 更多