Haskell 安装 Euterpea 依赖项时出现问题,Codecs 没有跳过安装的更高版本的版本检查

Issue while Haskell instaling Euterpea's dependency, HCodecs did not skip version check for a later version installed

今天在安装 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:\Users798\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:\Users798\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

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

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