尝试安装 Agda 2.6.1.2 时“无法加载模块 `Control.Monad.Trans.Maybe'”

问题描述

我正在尝试按照 instructions in the docs 安装 Agda 2.6.1.2,但是在运行命令 cabal install Agda 时我收到以下错误

src\full\Agda\Utils\Maybe.hs:13:1: error:
    Could not load module `Control.Monad.Trans.Maybe'
    It is a member of the hidden package `transformers-0.5.6.2'.
    Perhaps you need to add `transformers' to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
13 | import Control.Monad.Trans.Maybe
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal.exe: Failed to build Agda-2.6.1.2. See the build log above for details.

我正在以管理员身份运行 Powershell,我已经使用 Haskell 平台安装了 GHC 8.10.3 和 cabal 3.2.0.0,并且我已经运行了 cabal update 并安装了 Happy、Alex 和 Transformers。

我尝试删除并重新安装包括 Chocolatey 在内的所有内容,但这并没有解决问题。 此外,链接的说明提到将 Alex 和 Happy 添加到 PATH,但我不知道如何执行此操作。

我也尝试运行类似于 a proposed solution herecabal install Agda --allow-newer,但这给了我同样的错误

任何帮助将不胜感激!

完整输出

PS C:\WINDOWS\system32> cabal install Agda
Resolving dependencies...
Build profile: -w ghc-8.10.3 -O1
In order,the following will be built (use -v for more details):
 - Agda-2.6.1.2 (lib:Agda,exe:agda,exe:agda-mode) (requires build)
Starting     Agda-2.6.1.2 (all,legacy fallback)
Building     Agda-2.6.1.2 (all,legacy fallback)

Failed to build Agda-2.6.1.2.
Build log (
C:\Users\fredr\AppData\Roaming\cabal\logs\ghc-8.10.3\Agda-2.6.1.2-6a86b4da38fd320ba893c286a6f43f9d98f47bb1.log
):
Preprocessing executable 'agda-mode' for Agda-2.6.1.2..
Building executable 'agda-mode' for Agda-2.6.1.2..
[1 of 2] Compiling Paths_Agda       ( dist\build\agda-mode\autogen\Paths_Agda.hs,dist\build\agda-mode\agda-mode-tmp\Paths_Agda.o )
[2 of 2] Compiling Main             ( src\agda-mode\Main.hs,dist\build\agda-mode\agda-mode-tmp\Main.o )
Linking dist\build\agda-mode\agda-mode.exe ...
Preprocessing library for Agda-2.6.1.2..
Building library for Agda-2.6.1.2..
[  1 of 369] Compiling Agda.Interaction.Options.IORefs ( src\full\Agda\Interaction\Options\IORefs.hs,dist\build\Agda\Interaction\Options\IORefs.o )
[  2 of 369] Compiling Agda.Syntax.Builtin ( src\full\Agda\Syntax\Builtin.hs,dist\build\Agda\Syntax\Builtin.o )
[  3 of 369] Compiling Agda.Termination.CutOff ( src\full\Agda\Termination\CutOff.hs,dist\build\Agda\Termination\CutOff.o )
[  4 of 369] Compiling Agda.Termination.Semiring ( src\full\Agda\Termination\Semiring.hs,dist\build\Agda\Termination\Semiring.o )
[  5 of 369] Compiling Agda.Utils.AffineHole ( src\full\Agda\Utils\AffineHole.hs,dist\build\Agda\Utils\AffineHole.o )
[  6 of 369] Compiling Agda.Utils.applicative ( src\full\Agda\Utils\applicative.hs,dist\build\Agda\Utils\applicative.o )
[  7 of 369] Compiling Agda.Utils.BiMap ( src\full\Agda\Utils\BiMap.hs,dist\build\Agda\Utils\BiMap.o )
[  8 of 369] Compiling Agda.Utils.Environment ( src\full\Agda\Utils\Environment.hs,dist\build\Agda\Utils\Environment.o )
[  9 of 369] Compiling Agda.Utils.Except ( src\full\Agda\Utils\Except.hs,dist\build\Agda\Utils\Except.o )
[ 10 of 369] Compiling Agda.Utils.Fail  ( src\full\Agda\Utils\Fail.hs,dist\build\Agda\Utils\Fail.o )
[ 11 of 369] Compiling Agda.Utils.Function ( src\full\Agda\Utils\Function.hs,dist\build\Agda\Utils\Function.o )
[ 12 of 369] Compiling Agda.TypeChecking.SizedTypes.Utils ( src\full\Agda\TypeChecking\SizedTypes\Utils.hs,dist\build\Agda\TypeChecking\SizedTypes\Utils.o )
[ 13 of 369] Compiling Agda.Utils.Functor ( src\full\Agda\Utils\Functor.hs,dist\build\Agda\Utils\Functor.o )
[ 14 of 369] Compiling Agda.Utils.Haskell.Syntax ( src\full\Agda\Utils\Haskell\Syntax.hs,dist\build\Agda\Utils\Haskell\Syntax.o )
[ 15 of 369] Compiling Agda.Utils.IO    ( src\full\Agda\Utils\IO.hs,dist\build\Agda\Utils\IO.o )
[ 16 of 369] Compiling Agda.Utils.IO.Binary ( src\full\Agda\Utils\IO\Binary.hs,dist\build\Agda\Utils\IO\Binary.o )
[ 17 of 369] Compiling Agda.Utils.IO.Directory ( src\full\Agda\Utils\IO\Directory.hs,dist\build\Agda\Utils\IO\Directory.o )
[ 18 of 369] Compiling Agda.Utils.IO.UTF8 ( src\full\Agda\Utils\IO\UTF8.hs,dist\build\Agda\Utils\IO\UTF8.o )
[ 19 of 369] Compiling Agda.Utils.IO.TempFile ( src\full\Agda\Utils\IO\TempFile.hs,dist\build\Agda\Utils\IO\TempFile.o )
[ 20 of 369] Compiling Agda.Utils.IORef ( src\full\Agda\Utils\IORef.hs,dist\build\Agda\Utils\IORef.o )
[ 21 of 369] Compiling Agda.Utils.Impossible ( src\full\Agda\Utils\Impossible.hs,dist\build\Agda\Utils\Impossible.o )
[ 22 of 369] Compiling Agda.Utils.Empty ( src\full\Agda\Utils\Empty.hs,dist\build\Agda\Utils\Empty.o )
[ 23 of 369] Compiling Agda.Utils.Bag   ( src\full\Agda\Utils\Bag.hs,dist\build\Agda\Utils\Bag.o )
[ 24 of 369] Compiling Agda.ImpossibleTest ( src\full\Agda\ImpossibleTest.hs,dist\build\Agda\ImpossibleTest.o )
[ 25 of 369] Compiling Agda.Auto.NarrowingSearch ( src\full\Agda\Auto\NarrowingSearch.hs,dist\build\Agda\Auto\NarrowingSearch.o )
[ 26 of 369] Compiling Agda.Utils.IntSet.Infinite ( src\full\Agda\Utils\IntSet\Infinite.hs,dist\build\Agda\Utils\IntSet\Infinite.o )
[ 27 of 369] Compiling Agda.Utils.Lens  ( src\full\Agda\Utils\Lens.hs,dist\build\Agda\Utils\Lens.o )
[ 28 of 369] Compiling Agda.Utils.IndexedList ( src\full\Agda\Utils\IndexedList.hs,dist\build\Agda\Utils\IndexedList.o )
[ 29 of 369] Compiling Agda.Interaction.Library.Base ( src\full\Agda\Interaction\Library\Base.hs,dist\build\Agda\Interaction\Library\Base.o )
[ 30 of 369] Compiling Agda.Auto.Options ( src\full\Agda\Auto\Options.hs,dist\build\Agda\Auto\Options.o )
[ 31 of 369] Compiling Agda.Utils.Lens.Examples ( src\full\Agda\Utils\Lens\Examples.hs,dist\build\Agda\Utils\Lens\Examples.o )
[ 32 of 369] Compiling Agda.Utils.Map   ( src\full\Agda\Utils\Map.hs,dist\build\Agda\Utils\Map.o )
[ 33 of 369] Compiling Agda.Utils.Maybe ( src\full\Agda\Utils\Maybe.hs,dist\build\Agda\Utils\Maybe.o )

src\full\Agda\Utils\Maybe.hs:13:1: error:
    Could not load module `Control.Monad.Trans.Maybe'
    It is a member of the hidden package `transformers-0.5.6.2'.
    Perhaps you need to add `transformers' to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
13 | import Control.Monad.Trans.Maybe
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal.exe: Failed to build Agda-2.6.1.2. See the build log above for details.

解决方法

Agda (2.6.1.2) 的当前版本不支持 GHC 8.10.3。您需要使用受支持的 GHC 版本(例如 8.10.2)或从 Github 安装 Agda 的开发版本(支持 GHC 8.10.3,请参阅 https://github.com/agda/agda/issues/5109)。