今天安装 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
这就是我关于依赖项版本问题的整个日志
问题在于,Euterpea 完全依赖于 HCodecs 0.5.1 版本,而对 MonadFail 提案(从 GHC 8.8.1 开始完全实现)的支持仅在 0.5.2 版本中添加到 HCodecs 中。在 Euterpea 更新其依赖项列表之前,您有两种选择来解决此问题:要么将
--allow-newer
命令行标志传递给 cabal,这将导致它忽略版本上限,要么将 GHC 降级到最终版本 8.6.5没有完全实施 MonadFail 提案。在这种情况下,我推荐前者。
编辑:2022 年 6 月 17 日,Euterpea 的 Hackage 元数据修订版已发布以纠正此问题。